I'm working on extending the NotAMock framework for stubbing methods in rspec, and getting the stubs to yield to a methods block.
The code in this Gist works perfectly when I code it on my own (which is done-up to resemble how NotAMock stubs methods).
but when I incorporate the object.instance_eval... code into the NotAMock framework, the "block_given?" always returns false and I can never get my yield to work because of that. The method is added correctly, and I can call the stubbed method... but it will not recognize the block that i pass to the method, from the NotAMock stubbed version.
To see how i have incorporated this code into the NotAMock framework, go to my clone of NotAMock and check out the "add_hook" method in the private methods.
I know this is a bit much to ask... i'm hoping to find some guidance. it's been driving me nuts all day.