在「Programming Ruby 1.9/2.0」一書中,作者給出了一個網球得分類的例子,該類將通過在實際代碼之前編寫一些RSpec測試來開發。 筆者給大家介紹4個測試: it "should start with a score of 0-0"
it "should be 15-0 if the server wins a point"
it "should be 0-15 if the
我有一個控制器的規格是這樣的 describe :bizzaro_controller do
let(:credit_card_account) { FactoryGirl.build :credit_card_account }
it "doesn't blow up with just the stub" do
CreditCardAccount.stub(: