psyho / bogus

Fake library for Ruby
Other
359 stars 14 forks source link

Stubbing method to yield given block #44

Open mostlyobvious opened 10 years ago

mostlyobvious commented 10 years ago

Currently bogus does not support stubbing method to yield given block as in RR or rspec-mocks.

fgrehm commented 10 years ago

:+1: I've hit the same issue today :(

psyho commented 10 years ago

It would be easy to add a support for this for stubbing/mocking, but marrying it with contracts is definitely non-trivial.

I'll have to figure out how to record the values yielded by a method. If it turns out to be impossible (and I think that considering all the border cases with instance_exec and such it might be), then we'll have to decide if it's worth having a feature that does not integrate well with the rest of the library.