Skip to content
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

Switch to XCTests #69

Closed
AliSoftware opened this issue Jul 23, 2014 · 1 comment
Closed

Switch to XCTests #69

AliSoftware opened this issue Jul 23, 2014 · 1 comment

Comments

@AliSoftware
Copy link
Owner

This conversion from OCUnit to XCTest was waiting for a long time, especially because:

  • I wanted to keep the support for Xcode4 during the transition last year
  • OHHTTPStubs can target earlier iOS versions, and we should still be able to test on iOS versions not supporting NSURLSessions for example to check that it compiles and works correctly in such older OSes… but those older deployment targets dont support XCTest (the XCTest framework and especially its bundled executable that Xcode runs to execute the XCTests is not present in earlier simulators and the tests won't be able to launch at all)

Moreover, it seems that, with the cumulative migrations from earlier Xcode versions, my Unit Test target is somehow corrupted or whatnot, making the "Automatic Migration" to XCTest using the Xcode assistant not working properly to its whole extent (missing XCTest framework, odd unstable state after automatic migration, …) and leading to an incomplete migration.


But with Xcode6 coming, and OCUnit being not officially deprecated, we will really have to migrate eventually.

Note: Given that the automatic migration leaves some odd failures and strange states, I'll probably create a brand new Unit Tests target — or even maybe a brand new Xcode project/workspace ?!) and reimport my files in there, to start with a clean slate instead of risking importing all those corruptions that seems to have been introduced by previous migrations).
So this task will not be as simple as using the automatic assistant
😒


During that migration, I'll also migrate my asynchronous testing to use the new XCTestExpectations too — and using a custom implementation with the same API as Apple's for users still running Xcode5, at least during the transition from Xcode5 to Xcode6, so that it will be a transparent migration).

@AliSoftware
Copy link
Owner Author

Work started in branch XCTest.

Almost ready, just need some final checks:

  • ensure that nothing is broken: try to use it in a project (using it as a pod that points to this branch)
  • ensure it works the same way in Xcode5 and Xcode6 ; in particular when
    • an expectation is fulfilled twice
    • an expecation is fulfilled after its associated test has finished

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant