Skip to content

throwAssertion isn't available for any project using SwiftPM #674

@devioustree

Description

@devioustree
  • I have read CONTRIBUTING and have done my best to follow them.

What did you do?

Using Xcode 11, I tried to use throwAssertion() in a non-CLI project that uses SwiftPM for package management.

What did you expect to happen?

The documentation indicates that throwAssertion is not available for Swift CLI. Xcode 11 supports SwiftPM for non-CLI targets so I was hoping to make use of it in the unit tests for an app.

What actually happened instead?

The tests crash with a fatal error due to:

fatalError("The throwAssertion Nimble matcher does not currently support Swift CLI." +
            " You can silence this error by placing the test case inside an #if !SWIFT_PACKAGE" +
            " conditional statement")

Unfortunately, wrapping the tests inside #if !SWIFT_PACKAGE doesn't work because they are not inside a package - it is just Nimble that's in a package.

Environment

List the software versions you're using:

  • Nimble: 8.0.2
  • Xcode Version: 11.0 beta 6 (11M392q)
  • Swift Version: 5.1

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Swift Package Manager 5.1.0 (swiftpm-14696)

Project that demonstrates the issue

Clone the following project and run the tests: https://github.com/devioustree/ExampleNimbleAssertions

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions