Consider the following test:
class A def print(args) puts args end end describe A do let(:a) {A.new} it "receives print" do a.should_receive(:print).with("World").and_call_original a.print("Hello") a.print("World") end end
RSpec Documentation says:
Use the should_receive () function to set what the recipient should receive before this example completes.
So, I expected this test to pass, but it is not. It does not work with the following message:
Failures: 1) A receives print Failure/Error: a.print("Hello")
Is this the expected behavior? Is there any way to pass this test?
I am using ruby 1.9.3p374 and rspec 2.13.1
source share