June 17th, 2019
Suppose you have an Xcode project with spaces in the name.
In your unit tests you want to import the module so you can access your app’s classes in your unit tests. If you import the app project with the spaces,
@testable import My App
You’ll get errors from the compiler.
How do you import the project name? Replace the spaces with underscores.
@testable import My_App
Now you can access your app’s classes in your tests.
Tags: unit testing