只是尝试一些 RSpec 期望并想知道为什么会发生这种情况
describe "rspec" do
class Team
def players_on
11
end
end
it "does wierd things" do
hometeam1 = Team.new
hometeam1.should have(11).players_on
end
end
RSpec 显示错误
Failure/Error: hometeam1.should have(11).players_on
expected 11 players_on, got 8
如果我在期望中用 8 替换 11,它会通过
我的电脑有问题吗???