【发布时间】:2010-03-29 06:42:34
【问题描述】:
我试图让这个测试失败:)
it "should display the question" do
@ui.should_receive(:puts).with("What's your name?").once
@ui.ask_question("What's your name?")
end
即使我没有在我的函数中调用 puts,它也会通过。
【问题讨论】:
-
你的方法 ask_question 中的代码是什么?