Skip to content

AddsSetUp and tearDown to the XCTestCase protocol. #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2016
Merged

AddsSetUp and tearDown to the XCTestCase protocol. #26

merged 1 commit into from
Jan 7, 2016

Conversation

brownleej
Copy link
Contributor

The XCTestCase invokeTest method calls setUp and tearDown before and after the test case, but these calls are statically bound to the empty versions of setUp and tearDown provided by XCTestCase. If a real test case provides its own setUp and tearDown methods, they don't get called automatically. Adding them to the protocol should change this to a dynamic invocation and call the verisons provided by the real test case, which seems to be the intention behind calling them in the first place.

@briancroom
Copy link
Contributor

Hey @brownleej, thanks for opening this PR! I actually encountered this problem myself last weekend and ended up with the same fix as you. I would love to see this get merged.

On this note though, I'll mention that I do have other concerns with the XCTestCase protocol which I have written up here

mike-ferris pushed a commit that referenced this pull request Jan 7, 2016
AddsSetUp and tearDown to the XCTestCase protocol.
@mike-ferris mike-ferris merged commit c100709 into swiftlang:master Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants