Skip to content

dornad/PlaygroundTesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlaygroundTesting

Build Status Version License Platform

Unit Tests in Xcode Playgrounds ?

Playgrounds are a great way to prototype and (quickly) iterate on your codebase. However, Unit Tests are often left behind, or an afterthought.

It would be great to iterate on your unit tests as well! Unfortunately, Playgrounds do not support importing XCTest (yet).

Note: This is true as of Xcode 7.2.1

Enter PlaygroundTesting!

Imgur

Installation

PlaygroundTesting is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PlaygroundTesting"

To use PlaygroundTesting in your Playgrounds, you need to follow Apple's Guidelines for Importing Custom Frameworks into Playgrounds:

  • The framework is in the same workspace as the playground.
  • The framework has already been built.
  • The workspace contains at least one active scheme that builds a target.

Usage

PlaygroundTesting is very flexible. You can

  • Use XCTAssert & Friends directly on the Playground.
  • Create a Test Case Type that implements TestCaseProtocol and run its tests.
  • Run individual tests

The example project includes a sample Playground. To run the Playground, clone the repo, and run pod install from the Example directory first.

Author

Daniel Rodriguez, daniel@danielrodriguez.name

License

PlaygroundTesting is available under the MIT license. See the LICENSE file for more info.

About

Run Unit Tests in Xcode Playgrounds

Resources

License

Stars

Watchers

Forks

Packages

No packages published