[rspec-devel] [ rspec-Feature Requests-6978 ] mock should tell you the expected and actual args when receiving the right message with the wrong args

noreply at rubyforge.org noreply at rubyforge.org
Wed Nov 29 22:15:00 EST 2006


Feature Requests item #6978, was opened at 2006-11-30 03:15
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6978&group_id=797

Category: mock module
Group: None
Status: Open
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: David Chelimsky (dchelimsky)
Summary: mock should tell you the expected and actual args when receiving the right message with the wrong args

Initial Comment:
specify "..." do
  mock = mock('test mock')
  mock.should_receive(:message).with(1,2,3)
  mock.message(2,3,4)
end

will produce the following output:

Mock 'test mock' received unexpected message :something with [2,3,4]

It doesn't tell you what it actually got, which would be very helpful in understanding what went wrong. It should read:

Mock 'test mock' expected :message with [1,2,3] but received it with [2,3,4]

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6978&group_id=797


More information about the rspec-devel mailing list