在“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(: