The `take_while` implementation was a bit obtuse. It is simpler to just find the index of the singleton class and then just return all ancestors before it. This ensures that only modules which are prepended onto the specific singleton class we are dealing with (and not the singleton class of a superclass...) are considered, which was the root of the problem causing #745.
…tly when used with verifying doubles and partial doubles. Conflicts: Changelog.md spec/rspec/mocks/spy_spec.rb
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.
…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.