2012-07-18 275 views

回答

5

從 「How to name RSpec describe blocks for methods」:

  • 使用英鎊#method實例方法
  • 使用點.method類方法

在您的例子:

describe "#my_instance_method" do ... end 
describe ".my_class_method" do ... end 
+0

謝謝。我在哪裏可以找到關於此類最佳實踐的更多信息? – 2012-07-18 09:39:18

+1

來自這個演示非常好:http://pure-rspec-rubynation.heroku.com/和當然[RSpec書](http://pragprog.com/book/achbd/the-rspec-book ) – Stefan 2012-07-18 10:05:20

+0

非常好的演示文稿,感謝您的鏈接! – 2012-07-18 10:11:06