Closed idoru closed 8 years ago
Interesting point about not having to special case those classes now -- because that if
statement should bail out early when those classes don't conform to our protocol, it should be safe to call that function with any Class
. That's a great improvement to this bit of code.
Having slept on this, I'm not happy that these tests only really can see if the methods were called, but not when.
In fact, as soon as a single example runs (quite likely before this test), then +beforeEach
and +afterEach
on the conformant class will already have been called.
2db594b is closer to what I'm thinking but I only realized when I finally ran rake that this doesn't work on suites because the TestObservationHelper relies on XCTest.
Rebased from #365, some small refactoring and addition of tests for
+afterEach
hook.Tests for
+afterEach
are performed via asserts that are set up usingatexit(3)
since Cedar specs don't have visibility outside of their own context. Would like to know if anyone has better ideas for how to test this.@tjarratt and I debated the inclusion of the test classes in
CDRHooksSpec.mm
but we ultimately felt it made the distinguishing characteristics clear. Curious to know how others feel about it.This change also stops special casing for
UIAccessibilitySafeCategory__NSObject
andSCRCException
since we shouldn't expect them to conform toCDRHooks
.