searls/gimme — pull request #17 by gotascii (2013-12-16 15:21:52+00:00)
Title: Pass blocks sent to doubles along to the stubbed block via block arg

Currently, any blocks that are passed to methods on the double get dropped in `TestDouble#method_missing`. I would like to pass along blocks so I can test cases where a collaborator provides a method that takes a block. For example,

```ruby
class Collab
def wrapper(&block)
wrap
block.call
unwrap
end
end

class Sut
def initialize(wrapper)
@wrapper = wrapper
end

def behavior
wrapper.wrap { more_behavior }
end

def more_behavior
change_some_state
end
end

class SutTest
def test_behavior
wrapper = gimme
give(wrapper).wrap {|blk| blk.call }

sut = Sut.new(wrapper)
sut.behavior
assert_equal new_state, sut.state
end
end
```

My rspec is a little rusty (I've been using gimme a lot :) so hopefully the included test is acceptable. Let me know your thoughts or if I could tweak anything to get this into a state you'd be comfortable merging. Thanks!