INSTALL ======= INSTALL rspec ============= $ sudo gem install rspec OR $ ./script/plugin install git://github.com/dchelimsky/rspec.git INSTALL rspec_on_rails plugin ============================= $ ./script/plugin install git://github.com/dchelimsky/rspec-rails.git BOOTSTRAP THE APP ================= $ ./script/generate rspec create spec create spec/spec_helper.rb create spec/spec.
ãèªæ¸ææ³ãè«ççæèã¨ã¯ä½ã ââââ è«ççæèã¨ã¯ä½ã (岩波æ°æ¸ æ°èµ¤ç 2036)ä½è :渡é é å岩波æ¸åºAmazon Kindleçãããã¾ããè«ççæèã¨ã¯ä½ã (岩波æ°æ¸)ä½è :渡é é å岩波æ¸åºAmazon è«ççæèæ³ã¯ä¸çå ±éã§ã¯ãªããæèããç®çãã¾ãæ確ã«ãã¦ãã®ç®çã«åã£ãæèæ³ãé¸ã¶æè¡ãè¦ããâ¦
The RSpec Book: Behaviour Driven Development With RSpec, Cucumber, and Friends (The Facets of Ruby Series) ãã®æ¬ãæ¨æ¥ã®as_null_objectã¡ã½ããã«ç¶ãã¦ãletã¡ã½ããã¨ãã便å©ãªã¡ã½ãããç´¹ä»ãã¦ãããã RSpecãæ¸ãã¦ããã¨ãæ¨æ¥ã®ä¾ãããã ããbeforeãafterã使ããããã¤ã³ã¹ã¿ã³ã¹å¤æ°ã®åºçªãå¤ããªããã@ï¼ã¢ãããã¼ã¯ï¼ãã ããã«ãªã£ã¦æ°æã¡æªããªãã æ¨æ¥ã®ä¾â require 'my_class' describe MyClass do describe "ã¯ãrunã¡ã½ããå®è¡æã«ã" do before(:each) { @obj = mock.as_null_object } it "åæåæã«æ¸¡ãããªãã¸ã§ã¯ãã®pre_execã¡ã½ããã
ãã®åè²·ã£ãRSpecæ¬ãèªã¿é²ãããã£ã¨RSpecã«ã¤ãã¦æ¸ãã¦ããï¼ç« ãDescribing Code with RSpecãã¾ã§ãã©ãã¤ããã The RSpec Book: Behaviour Driven Development With RSpec, Cucumber, and Friends (The Facets of Ruby Series) ããã¨ããããªããas_null_objectã¨ãã便å©ãªã¡ã½ãããç´¹ä»ãã¦ãããï¼æ¬ã®ä¾ããã®ã¾ã¾è¼ããããªããã©ãä¾ãã°ããããæâã«ä¾¿å©ããã ã require 'my_class' describe MyClass do describe "ã¯ãrunã¡ã½ããå®è¡æã«ã" do it "åæåæã«æ¸¡ãããªãã¸ã§ã¯ãã®pre_execãbody_execã¡ã½ãããå¼ã¶" do obj = mock my_class = MyC
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}