freerange/mocha — pull request #119 by simao (2012-12-20 10:12:26+00:00)
Title: Implemented restrict_to_instance_of

This new method in `mock.rb` restricts methods being mocked to the methods included in the `instance_methods` of the class passed in as argument.

The reasoning behind this, is because sometimes you can't easily instantiate a new object of that class and pass that into `responds_like`, can be because you have lot's of dependencies on that class, because it's computationally expensive, etc etc.

If you like the idea I will write documentation for this new method. If you think the implementation could be better I am happy to update the pull request.

Thanks!