rspec/rspec-mocks — pull request #223 by RyanonRails (2013-02-07 17:33:59+00:00)
Title: disallow unstub! on any_instance

Calling **unstub!** on any_instance threw me for a bit of a loop today.

Scenario (Cucumber before do):
```
Before do
User.any_instance.stub(:after_database_authentication)
end
```

This works:
```
And /^And I do stuff$/ do
User.any_instance.unstub(:after_database_authentication)
end
```

This breaks:
```
And /^And I do stuff$/ do
User.any_instance.unstub!(:after_database_authentication)
end
```

In pry:

Good:
```
User.any_instance.unstub(:after_database_authentication)
=> :after_database_authentication
```

Bad:
```
User.any_instance.unstub!(:after_database_authentication)
RSpec::Mocks::MockExpectationError: The method `after_database_authentication` was not stubbed or was already unstubbed
from /Users/ryan/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-mocks-2.9.0/lib/rspec/mocks/method_double.rb:181:in `raise_method_not_stubbed_error'
```

This should prevent any future headaches. I'm unsure of any scenarios where you would use the current implementation of any_instance.unstub! (let me know if you do!).