{"action":"created","issue":{"url":"https://api.github.com/repos/rspec/rspec-mocks/issues/895","labels_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/895/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/895/comments","events_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/895/events","html_url":"https://github.com/rspec/rspec-mocks/issues/895","id":57842389,"number":895,"title":"'disallow' an allowance?","user":{"login":"ToadJamb","id":488923,"avatar_url":"https://avatars.githubusercontent.com/u/488923?v=3","gravatar_id":"","url":"https://api.github.com/users/ToadJamb","html_url":"https://github.com/ToadJamb","followers_url":"https://api.github.com/users/ToadJamb/followers","following_url":"https://api.github.com/users/ToadJamb/following{/other_user}","gists_url":"https://api.github.com/users/ToadJamb/gists{/gist_id}","starred_url":"https://api.github.com/users/ToadJamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToadJamb/subscriptions","organizations_url":"https://api.github.com/users/ToadJamb/orgs","repos_url":"https://api.github.com/users/ToadJamb/repos","events_url":"https://api.github.com/users/ToadJamb/events{/privacy}","received_events_url":"https://api.github.com/users/ToadJamb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-16T19:26:22Z","updated_at":"2015-02-22T21:30:12Z","closed_at":null,"body":"I like to provide a class that contains the interface to external/dangerous things and then use a global `before` block to inspect the class/module and raise errors if any of the methods are called without being mocked/stubbed. I want to use a helper method that looks something like this:\r\n\r\n```ruby\r\n    def not_implemented(klass, method)\r\n      allow(klass)\r\n        .to receive(method)\r\n        .and_raise NotImplementedError,\r\n          \"#{klass}.#{method} has been stubbed as not implemented.\"\r\n    end\r\n```\r\n\r\nI was using mocha before (using `stub` and `unstub`), but I'm trying to convert to rspec-mocks. Is there a way to 'disallow' an 'allowance' so that I can then provide expectations without raising an error? My trials have resulted in either raising the stubbed error above or unmet expectations."},"comment":{"url":"https://api.github.com/repos/rspec/rspec-mocks/issues/comments/75461238","html_url":"https://github.com/rspec/rspec-mocks/issues/895#issuecomment-75461238","issue_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/895","id":75461238,"user":{"login":"ToadJamb","id":488923,"avatar_url":"https://avatars.githubusercontent.com/u/488923?v=3","gravatar_id":"","url":"https://api.github.com/users/ToadJamb","html_url":"https://github.com/ToadJamb","followers_url":"https://api.github.com/users/ToadJamb/followers","following_url":"https://api.github.com/users/ToadJamb/following{/other_user}","gists_url":"https://api.github.com/users/ToadJamb/gists{/gist_id}","starred_url":"https://api.github.com/users/ToadJamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToadJamb/subscriptions","organizations_url":"https://api.github.com/users/ToadJamb/orgs","repos_url":"https://api.github.com/users/ToadJamb/repos","events_url":"https://api.github.com/users/ToadJamb/events{/privacy}","received_events_url":"https://api.github.com/users/ToadJamb/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T21:30:12Z","updated_at":"2015-02-22T21:30:12Z","body":"Thank you! I did manage to get everything working close enough to the way I wanted. I did have one other thing come up, though. I couldn't quite figure out how to return different results from a method given the same inputs (this applies to yielding, as well). Is there a way to do that?"}}