Open dipth opened 12 years ago
Sorry for the late reply here, I just took over this project and am reviewing old issues.
First I believe you may need to do this:
context "when yields calls are chained" do
it "yields several times" do
called_from_block = mock!.foo(1).once.then.foo(2).once.subject
block_caller = stub!.bar.yields(1).then.bar.yields(2).subject
block_caller.bar { |argument| called_from_block.foo(argument) }
end
end
Second, you're only calling the #bar method on block_caller once so I don't know why you have two yields there.
I don't know if you remember this issue still or are even concerned anymore but if so can you give me a failing test? Thanks.
According to
stub_spec.rb
it should be possible to chain multiple calls toyields
to make the stub invoke the block for each call to`yields
with the specified arguments.This doesn't seem to work in our production app though. I've tried copying over the exact test and it fails with the following error:
When I dig depper into it, I can see that it only invokes the block with the second argument.
We're using Ruby 1.9.3-p125 - but the funny thing is that I've run the rr test suite with the exact same ruby version where it completes successfully.