Spry alternatives and similar libraries
Based on the "TDD / BDD" category.
Alternatively, view Spry alternatives based on common mentions on social networks and blogs.
-
OHHTTPStubs
Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers! -
swift-corelibs-xctest
The XCTest Project, A Swift core library for providing unit test support -
SwiftyMocky
Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more. -
PlaygroundTDD
Small library to easily run your tests directly within a Playground
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Spry or a related project?
Popular Comparisons
README
Spry
Spry is a Swift Playgrounds Unit Testing library based on Nimble.
The best thing about Spry is that the API matches Nimble perfectly. Which means once you've created your code and tests in a Playground, you can copy them directly into your Xcode project without needing to (re)write them again :)
Nimble: The code in this library has been copied directly from the Nimble project. However it is currently a stripped down version.
Download
There are a couple of ways you can download Spry.
Template
You can download a Playground including the latest version of Spry. Consider this a boilerplate template. It includes Spry in the Sources
folder of the Playground, so you can simply start writing tests alongside your code in the Playground.
Manual
You can also download or checkout this repo and simply copy the files into your existing Playground manually. Simply copy the entire Spry
folder into your Playground's Sources
folder. Easy Peasy!
Nimble-esque
Spry is a stripped down (Lite) version of Nimble that includes a subset of Nimble's Matchers.
Note: This is a port of Nimble only, since Quick doesn't really make sense in the context of a Playground.
The following features are NOT supported (since they are a part of Quick):
describe
context
it
The following features are already implemented:
- [x]
expect
- [x]
to
- [x]
beAKindOf
- [x]
beAnInstanceOf
- [x]
beCloseTo
- [x]
beEmpty
- [x]
beginWith
- [x]
beGreaterThan
- [x]
beGreaterThanOrEqualTo
- [x]
beIdenticalTo
- [x]
beLessThan
- [x]
beLessThanOrEqualTo
- [x]
beLogical
- [x]
beNil
- [x]
beVoid
- [x]
containElementSatisfying
- [x]
contain
- [x]
endWith
- [x]
equal
- [x]
haveCount
- [x]
match
- [x]
satisfyAnyOf
The following features are not yet implemented:
- [ ]
toEventually
- [ ]
async
- [ ]
matchError
- [ ]
throwError
- [ ]
failWithMessage
Usage
Using Spry is as simple as writing an expect
case:
func add<T: ExpressibleByIntegerLiteral>(_ x: T, _ y: T) -> T {
return x + y
}
// Spry test case
expect(add(4, 5)).to(equal(9))
If you're already familiar with Nimble, then you already know how to use Spry.
For full details on how to write your tests with Spry, I suggest reading over the Nimble docs. Keeping in mind that not all features are currently included.
*Note that all licence references and agreements mentioned in the Spry README section above
are relevant to that project's source code only.