cedarbdd / cedar

BDD-style testing using Objective-C
http://groups.google.com/group/cedar-discuss
1.19k stars 140 forks source link

Crash due to some specific classes during beforeEach hook #365

Closed dulacp closed 8 years ago

dulacp commented 8 years ago

For me the culprit class is GAITrackerModel but for others it can be another class. The crash happens in the CDRClassHasClassMethod function.

The solution is probably to have only the defined classes that register the CDRHooks just like specta did in the issue specta#149.

Cheers

tjarratt commented 8 years ago

Thanks for opening this issue @dulaccc! I can see how this would be pretty annoying if you had classes you didn't control executing arbitrary code in your tests. This would be a breaking change, but it seems like a good idea.

Would you be interested in extending the spec for beforeEach to add a class that does not explicitly conform to the protocol and verify that it's -beforeEach and -afterEach methods were not invoked? It would be nice to have some test coverage for this change.

idoru commented 8 years ago

Following up with a rebased revision on PR #387, thanks for your contribution @dulaccc!

dulacp commented 8 years ago

Always a pleasure 👍