When running global before and after hooks, we were picking up any class that implented +beforeEach and/or +afterEach. You could opt-out by conforming to the SPTExcludeGlobalBeforeAfterEach protocol. This could cause difficult to debug failures when it picked up imported classes. This commit reverses the approach, creating a SPTIncludeGlobalBeforeAfterEach protocol, which SPTExampleGroup implements. Now we only select classes that implement SPTIncludeGlobalBeforeAfterEach for running global +beforeEach and/or +afterEach. You can opt-in by implementing the protocol.
This patch resets and increments the number of ran test cases also for pending test cases. It fixes a problem that the `afterAll` or `beforeAll` blocks might ran multiple times. This would happen when you declare pending blocks as your first or last blocks In this case of `afterAll`, the comparison `group.ranExampleCount + group.pendingExampleCount == group.exampleCount` will always be true, leading to the multiple execution of the afterAll blocks. The same is applied for `beforeAll`. If the pending blocks are declared before the other test cases, the comparison `group.ranExampleCount == 0` will be true and the `beforeAll` blocks will be called multiple times.