{"action":"closed","issue":{"url":"https://api.github.com/repos/erikdoe/ocmock/issues/174","labels_url":"https://api.github.com/repos/erikdoe/ocmock/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/erikdoe/ocmock/issues/174/comments","events_url":"https://api.github.com/repos/erikdoe/ocmock/issues/174/events","html_url":"https://github.com/erikdoe/ocmock/issues/174","id":55170363,"number":174,"title":"Reject exceptions persisting across tests","user":{"login":"grantjk","id":1066132,"avatar_url":"https://avatars.githubusercontent.com/u/1066132?v=3","gravatar_id":"","url":"https://api.github.com/users/grantjk","html_url":"https://github.com/grantjk","followers_url":"https://api.github.com/users/grantjk/followers","following_url":"https://api.github.com/users/grantjk/following{/other_user}","gists_url":"https://api.github.com/users/grantjk/gists{/gist_id}","starred_url":"https://api.github.com/users/grantjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantjk/subscriptions","organizations_url":"https://api.github.com/users/grantjk/orgs","repos_url":"https://api.github.com/users/grantjk/repos","events_url":"https://api.github.com/users/grantjk/events{/privacy}","received_events_url":"https://api.github.com/users/grantjk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-22T15:57:58Z","updated_at":"2015-02-16T19:11:07Z","closed_at":"2015-02-16T19:11:07Z","body":"I have an issue where when I purposefully add a failing test using the `reject` method, it creates a failing test in a different test. When I run these tests individually, they work as expected.\r\n\r\nIn the code below, I'm expecting the third test to fail.  When I run these tests individually, the first two pass and the third fails. When I run them all together, the third one fails as expected, but the first one also fails with the message:\r\n````\r\ntestThatItNotifiesDelegateWhenVideoFailsToPlay] : failed: caught \"NSInternalInconsistencyException\", \"movieObserverDidFailToLoadVideo:<OCMAnyConstraint: 0x7fab99e84c20>: explicitly disallowed method invoked: movieObserverDidFailToLoadVideo:<CURMoviePlayerObserver: 0x7fab99e84f10>\"\r\n````\r\n\r\nMaybe I'm missing something or set it up wrong, but I'd be interested in feedback.\r\n\r\nThanks,\r\n-JG\r\n\r\n\r\n\r\n\r\n````\r\n- (void)testThatItNotifiesDelegateWhenVideoFailsToPlay\r\n{\r\n    OCMExpect([self.delegate movieObserverDidFailToLoadVideo:self.observer]);\r\n    \r\n    NSDictionary *info = @{ MPMoviePlayerPlaybackDidFinishReasonUserInfoKey : @(MPMovieFinishReasonPlaybackError) };\r\n    [[NSNotificationCenter defaultCenter] postNotificationName:MPMoviePlayerPlaybackDidFinishNotification\r\n                                                        object:self.player\r\n                                                      userInfo:info];\r\n    OCMVerifyAll(self.delegate);\r\n}\r\n\r\n- (void)testThatItDoesNotNotifyTheDelegateWhenVideoStopsWithoutError\r\n{\r\n    [[self.delegate reject] movieObserverDidFailToLoadVideo:OCMOCK_ANY];\r\n    \r\n    NSDictionary *info = @{ MPMoviePlayerPlaybackDidFinishReasonUserInfoKey : @(MPMovieFinishReasonPlaybackEnded) };\r\n    [[NSNotificationCenter defaultCenter] postNotificationName:MPMoviePlayerPlaybackDidFinishNotification\r\n                                                        object:self.player\r\n                                                      userInfo:info];\r\n    [self.delegate verify];\r\n}\r\n\r\n- (void)testThatItDoesNotNotifyTheDelegateWhenNotificationPostedFromADifferentPlayer\r\n{\r\n    [[self.delegate reject] movieObserverDidFailToLoadVideo:OCMOCK_ANY];\r\n    \r\n    NSDictionary *info = @{ MPMoviePlayerPlaybackDidFinishReasonUserInfoKey : @(MPMovieFinishReasonPlaybackError) };\r\n    [[NSNotificationCenter defaultCenter] postNotificationName:MPMoviePlayerPlaybackDidFinishNotification\r\n                                                        object:OCMClassMock([MPMoviePlayerController class])\r\n                                                      userInfo:info];\r\n    [self.delegate verify];\r\n}\r\n````"}}