Preserve null objectness when copying test doubles.
Remove redundant allow.
I originally thought this was required to allow use of the `have_received` matcher, but not sure what I was thinking.
Add failing spec demonstrating issue.
…tly when used with verifying doubles and partial doubles.
Add failing spec for and_yield regression.
Address ruby warning.
rspec-mocks/spec/rspec/mocks/and_yield_spec.rb:114: warning: assigned but unused variable - default_arg
- Remove extra blank line. - Fix spelling on Sam’s name. [ci skip]
Sketch implementation of ordered with counts
Using ruby 2.1.2 ```ruby default_arg = Object.new obj = Object.new allow(obj).to receive(:a_message).and_yield expect(default_arg).to receive(:bar) obj.a_message do |receiver=default_arg| receiver.bar end ``` The above code fails with: ``` Failure/Error: obj.a_message do |receiver=default_arg| #<Object:0x007fe3ac1ce408> yielded || to block with arity of 1 ``` The block has a arity of 0 or 1 not 1. So I would expect that when no argument is given to `and_yield` it would use the default block argument.
Verifying doubles should expire just like normal doubles.
…0 but 3.0.x releases are out.
Fix invitation typo in readme
Fix edge case that triggered “can't add a new key into hash during iteration"
…eration”. This was triggered when a double was used as a `with` arg but was otherwise unused — in this case, there was no mock proxy for it, but while verifying one would get created (due to internal implementation details). Doing so in a `each_value` loop caused the error.
Adds spying methods to the RSpec Mocks DSL
Specifically adds: * spy - responds and spies all methods * instance_spy - responds and spies all methods to which a specified class responds. * object_spy - responds and spies all methods to which a specific instance responds * class_spy - responds and spies all class methods to which a specific class responds I added test coverage for the expected behaviours and added some YARD docs to the new methods.