rspec/rspec-mocks — pull request #714 by tom025 (2014-06-13 23:02:28+00:00)
Title: `and_yield` not using default block argument when no argument given.

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|
# 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.

I have a supplied a test that exposes this but I'm not sure how to fix this.