This is one of the final post leading up the the launch of the Build a Ruby Gem Ebook, which is now available for sale in 3 packages, including 14 chapters of code and over 2 hours of screencasts. The world isnât black and white (as much as weâd like to believe it is). Just because our gemâs functionality may work for us, doesnât mean itâll work for everyone. Fortunately, we can give users the abi
Google+ãã¿ã³ ã¯ã¦ãªããã¯ãã¼ã¯ãã¿ã³ æ´æ°æ¥æ: 2014å¹´02æ25æ¥ï¼ç«ï¼ ä½ææ¥æ: 2013å¹´08æ06æ¥ï¼ç«ï¼ åã®è¨äº / 次ã®è¨äº Fixtureã¯å åã«ã¤ã±ã¦ãã¨æã£ã¦ããã®ã§ãåºæ¬Fixtureã§æºè¶³ãªãã ãã©ã Fixtureã«ã§ããªããã¨ãããããã«ãFactoryGirlã使ã£ã¦ã¿ããã¨æãç«ã£ãã¡ã¢ã èªåãç¥ããªãã ãã§Fixtureã§ããã®ããç¥ããªããã©ã DBã«ä¿åã¯ããªããã©å¤ã ã欲ããæãããã Rspecã§è¨ã㨠"valid_attributes" ã§ããå¤ã ä»ã¾ã§ã¯èªåã§é©å½ã«ã¢ã¸ã¥ã¼ã«ã¤ãã£ã¦èªã¿è¾¼ãã§ããã ãã©ã æè§FactoryGirlã£ã¦gemããããã ãã使ã£ã¦ã¿ãããã¨æã£ãã â» é©å½ã«ã©ãã©ã追å ãã¦ãã£ããããªãé·ããªã£ã¦ãã¾ã£ãã®ã§ æã訪ãããã¾ã¨ãã¦æ°ããè¨äºã«ãããã¨æãï¼2014/02/25ï¼ ä½å¹´å¾ã«ãª
Myron MarstonJan 14, 2014One of RSpec 3âs big new features is shipping 3.0.0.beta2: composable matchers. This feature supports more powerful, less brittle expectations, and opens up new possibilities. An Example In RSpec 2.x, Iâve written code like this on many occassions: # background_worker.rb class BackgroundWorker attr_reader :queue def initialize @queue = [] end def enqueue(job_data) queue <<
éAdvent Calendar 1æ¥ç®ã®è¨äºã¨ãã¦ãæè¿ã®éçºã«ãããå¿ã®éã«è§¦ãã¾ãã æè¿éçºãã Autodoc ã¨ãããã¼ã«ã«ã¤ãã¦ç°¡åã«èª¬æããå¾ã ãã®æã®ãã¼ã«ã®éçºã«ããã£ã¦èãã¦ããã åµä½æ´»åã®å¨ãæ¹ãã社ä¼ã®æ¥åã25æ³å®å¹´èª¬ãªã©ã«ã¤ãã¦è§¦ãããã¨æãã¾ãã Autodocã¨ã¯ Rack applicationã§å®è£ ãããAPIã«å¯¾ãã¦ãRSpecã§æ¸ããããã¹ããå ã«APIããã¥ã¡ã³ããçæãããã®ã ãã¹ããå®è¡ããã¨ããã¹ãä¸ã«çºè¡ãããªã¯ã¨ã¹ããã¬ã¹ãã³ã¹ããã®ãã¹ãã«ä»ããããã¡ãã»ã¼ã¸ãå ã«ã è¯ãæãã«æ å ±ãã¾ã¨ããMarkdownå½¢å¼ã§APIããã¥ã¡ã³ããè¨ãããã¡ã¤ã«ãçæãã¦ãããã ä¾ãã°GitHubã§ã¯Markdownãã¡ã¤ã«ãé©å½ã«æç»ãã¦ãããã®ã§ã ä¸å³ã®ããã«GitHubä¸ã§ç°¡åã«ããã¥ã¡ã³ããé²è¦§åºæ¥ãããã«ãªãã ãã¹ãã®æ¸ãæ¹
translations Documentation RSpec is a great tool in the behavior-driven development (BDD) process of writing human readable specifications that direct and validate the development of your application. On the web there are many resources that give complete overview of _what_ you can do with RSpec. But there are fewer resources devoted to how to create a great RSpec test suite. Better Specs tries to
rspec-mocks helps to control the context in a code example by letting you set known return values, fake implementations of methods, and even set expectations that specific messages are received by an object. You can do these three things on test doubles that rspec-mocks creates for you on the fly, or you can do them on objects that are part of your system. Messages and Methods Message and method a
Rspec/Capybara/Turnipã®å ¥éè¨äºãå ¨åã§ã¾ã¨ãã¦ã¿ã Aug 30th, 2013 Tweet ãã£ããã The Rspec Bookããèªã¿çµãã¾ãããåãã®æ¬ã§ãããRspecãCucumberãWebratãSeleniumãªã©ãæ´»ç¨ããããã®ãã¦ãã¦æºè¼ã§å¤§æºè¶³ã§ããï¼ ã¨ãããã¨ã§ããã®æ¬ã§èªãã å 容ãå¿ããªãããã«ããããã¨ããã®éç¨ã§Rspec/Capybaraãªã©ã®ãããè³æããã¤ããã®ã§ãã¾ã¨ããããã«ãã®è¨äºãæ¸ãã¾ãããããééããçºè¦ããå ´åãä»ã«ããããªã½ã¼ã¹ãããã°ãæ¯éã¡ãã»ã¼ã¸ãé¡ããã¾ãï¼ ãã¹ãé§åéçº(TDD)ã¨æ¯ãèãé§åéçº(BDD) ãã¹ãé§åéçº(TDD)ã¨ã¯ãã³ã¼ããæ¸ãéã«æåã«ãã¹ããæ¸ãã次ã«ãã¹ããéãæä½éã®ã³ã¼ããæ¸ãããã®å¾ã«ãªãã¡ã¯ã¿ãªã³ã°ãã¦ããéçºææ³ã§ããä¸æ¹ã§æ¯ãèãé§åéçº(BDD)ã¯TDDã®çº
ååã®ã¢ãã«ã®ãã¹ãã§ã¯ãå§ãåãå§ï¼ã«ãï¼ãåï¼ã«ãï¼ã¨ãã4ã¤ã®å±æ§ã«å¯¾ãã¦ãã空ã§ãã£ã¦ã¯ãªããªããã¨ããä»æ§ãRSpecã§è¨è¿°ãããã¹ããã¾ããã ããããããã»ã©ç°¡åãªä»æ§ã«ãã¦ã¯ãã¹ãã³ã¼ããè¤éã§ãããã ä»åã¯ããã®ãã¹ãã³ã¼ãã®ç°¡ç´ åããã¼ãã§ãã 妥å½ãªãªãã¸ã§ã¯ãã®ãã¹ãã追å ååæ¸ãããã¹ãã³ã¼ãã®æçµå½¢ã¯æ¬¡ã®éãã§ãï¼ require 'spec_helper' describe Customer do %w{family_name given_name family_name_kana given_name_kana}.each do |column_name| specify "#{column_name} ã¯ç©ºã§ãã£ã¦ã¯ãªããªã" do customer = Customer.new( family_name: 'å±±ç°', given_name: '太é'
ååã¯RSpecã®åºæ¬ã¡ã½ããã«ã¤ãã¦ã¾ã¨ãã¾ãããä»åã¯Mockã«ã¤ãã¦ã¾ã¨ãã¾ãã ãã¹ãããã«ã¨ã¯ ãã¹ã対象ãä¾åãã¦ããã¢ã¸ã¥ã¼ã«ããªã½ã¼ã¹ã®ä»£å½¹ã®ãã¨ãçµåãã¹ãã®ãããªè¤éãªç°å¢ãäºåã«ç¨æããã¨ãç®çã®æ©è½ããã¹ãå¯è½ã¨ãªãããã«æ¯ãèããã·ãã¥ã¬ã¼ãããã irb,pryçã§Mockã試ãããæã
Thorã§ã¿ã¹ã¯ãæ¸ãã¨ãã®ã¡ã½ãããæ®éã®Rubyã®ããã«ã¯å¼ã¹ã¾ããã ããã§ããã£ã±ããã¹ãã¯æ¸ãããã®ã§Thorã®specãããããè¦ã¦ããããã¾ããã # encoding: utf-8 require "rubygems" require "thor" require "rspec" require "stringio" class Sample < Thor desc "name", "sample name" def name puts "pochi" end end describe Sample do it "should display 'pochi'" do capture(:stdout) { Sample.new.invoke("name") }.strip.should == "pochi" end end
ãã®ã¦ã§ããµã¤ãã¯è²©å£²ç¨ã§ãï¼ twiwt.org ã¯ãããªãããæ¢ãã®æ å ±ã®å ¨ã¦ã®ææ°ãã¤æé©ãªã½ã¼ã¹ã§ããä¸è¬ãããã¯ããããããæ¤ç´¢ã§ããå 容ã¯ãtwiwt.orgãå ¨ã¦ã¨ãªãã¾ããããªãããæ¢ãã®å 容ãè¦ã¤ãããã¨ãé¡ã£ã¦ãã¾ãï¼
ããã«ã¡ã¯ãã»ããã§ããAsset Pipeline ã«æéãåãã¦ããä»æ¥ãã®é ã§ãã ä»æ¥ã¯ç¤¾å 㧠RSpec ãããããåå¼·ããããã ãã©æ¤ç´¢ãã¦ãããããããªãï¼ã¨è³ªåãåããã®ã§ãèªãã¹ãã¨ã³ããªãã¾ã¨ãã¦ã¿ã¾ããã ï¼ ç¾ç¶ããã㨠RSpec.info ãã¾ãåºã¦ãããã©ããæ´æ°ããã¦ãªãã£ã½ãã®ã§åªãããªããã§ãããâ¦â¦ h2. ããã¯èªãã§ãããï¼ h3. ã¹ã¯ã¹ããã¯ã®ã¹ * âã¹ã¯ã¹ããã¯ã®ã¹ ã第 1 åã RSpec ã®æ¦è¦ã¨ãRSpec on Rails (ã¢ãã«ç·¨)â:http://jp.rubyist.net/magazine/?0021-Rspec * âã¹ã¯ã¹ããã¯ã®ã¹ ã第 2 åã RSpec on Rails (ã³ã³ããã¼ã©ã¨ãã¥ã¼ç·¨)â:http://jp.rubyist.net/magazine/?0023-Rspec å 容ã¯è¥å¹²å¤ãã®ã§ããã
æ°ç±³ã¨ç§åéã®ããç¼ã ãåºèº«ç¨ã®ç§åéãè²·ãã¾ããã1å°¾250åã§ã 3æã«ãããã¦ãç§åéã®ããã«é ãå³éãé¤æ²¹ã§èª¿å³ãã¦1æéã»ã©æ¼¬ãè¾¼ã¿ãã°ãªã«ã§ç¼ãã¾ãã ç§åéã®ããç¼ã ããã®ãè¦å³ãç¨ãããã¤ã«ãã«èª¿å³ãããã¯ã»ã«ãªãå³ããã§ã è¶ãããªæ°ç±³ã¨ä¸ç·ã« èªå®¶è£½ãæ¼¬ç© åâ¦
ããã³ã¾ãã¯ãRuby ã«é¢ããæè¡è¨äºã¯ãã¡ããã®ãã¨ãRubyist ã¸ã®ã¤ã³ã¿ãã¥ã¼ãã¨ãã»ã¤ããã®ä»ããå±ãããã¦ã§ãéèªã§ãã Rubyist Magazine ã«ã¤ã㦠ãRubyist Magazineããç¥ãã¦ããã³ã¾ãã¯ãæ¥æ¬ Ruby ã®ä¼ã®æå¿ã«ãã Rubyist ã® Rubyist ã«ãããRubyist ã¨ããã§ãªã人ã®ããã®ã¦ã§ãéèªã§ãã ææ°å· Rubyist Magazine 0058 å· ããã¯ãã³ãã¼ Rubyist Magazine 0058 å· RubyKaigi 2018 ç´åç¹éå· Rubyist Magazine 0057 å· RubyKaigi 2017 ç´åç¹éå· Rubyist Magazine 0056 å· Rubyist Magazine 0055 å· Rubyist Magazine 0054 å· æ±äº¬ Ruby ä¼è° 11 ç´
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}