seattlerb/minitest — pull request #120 by bhenderson (2012-04-23 23:02:57+00:00)
Title: Mocker module for extending any object

I wrote a patch for minitest/mock which allows any object to be extended with expect/verify methods.

```ruby
@mock = Object.new
def @mock.foo() 'hi' end
@mock.extend MiniTest::Mocker
@mock.expect :foo, 'hello world'
@mock.foo # => 'hello world'

@mock.verify # => true
@mock.foo # => 'hi'
```

Is this interesting to you at all? Method restoration is done via method aliasing.