Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
add warning about change in behaviour of stub/mock combinations [#644…
Browse files Browse the repository at this point in the history
… state:wontfix]
  • Loading branch information
dchelimsky committed Jan 4, 2009
1 parent 3b1e09d commit 124c00d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions History.txt
@@ -1,5 +1,17 @@
=== Maintenance

WARNING: there was a stub/mock bug in 1.1.11 that allowed a structure that was
not intended:

obj.stub!(:msg)
obj.msg
obj.should_receive(:msg)

That would pass in 1.1.11, but should not have been allowed to, since the
message is received before the expectation is set. This was reported (#637)
and fixed for release 1.1.12, but may cause unexpected failures if you had
examples set up as above.

* 2 deprecations

* deprecated ExampleMethods#implementation_backtrace - use ExampleMethods#backtrace instead
Expand Down

4 comments on commit 124c00d

@adzap
Copy link

@adzap adzap commented on 124c00d Jan 7, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts on something like a ‘should_have_received’ expectation? This would be akin to the not_a_mock plugin (see notahat/not_a_mock on github)

@bmabey
Copy link
Contributor

@bmabey bmabey commented on 124c00d Jan 8, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adzap, we have discussed bringing the test spy pattern to rspec on the mailing list a couple of times. I think Pat was even implementing it. However, once it was brought up that the functionality already existed in the form of the plugin that you mentioned most effort on it ceased. If you still think it should be part of rspec proper, then I would recommend bringing it up again on the rspec mailing list or submitting a lighthouse ticket.

@adzap
Copy link

@adzap adzap commented on 124c00d Jan 8, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bmabey, very interesting. I do prefer that pattern for message expectations so I think it worth investigating. The plugin has some draw backs to it so integrating into rspec proper would be best.

Will have a look at the rspec code and have a go at a patch.

@josephwilk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side note the RR mocking framework which can be used with Rspec supports test spies.

http://github.com/btakita/rr/tree/master

Please sign in to comment.