Based on the code:
require 'rubygems'
require 'spec'
class UI
def ask_question(q)
end
end
describe UI do
before do
@ui = UI.new
end
it "should display the question" do
@ui.should_receive(:puts).with("Whats your name?").once
@ui.ask_question("Whats your name?")
end
end
I get a failure:
F
1) Spec::Mocks::MockExpectationError in 'UI should display the question'
Finished in 0.002575 seconds
1 example, 1 failure
What version of RSpec are you using?
source
share