840 GitHub stars and counting — railsware/Sleipnir is a multi-language project TopGit is tracking across repositories on the platform.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Sleipnir is a BDD-style framework for Swift. Sleipnir is highly inspired by Cedar.
Also
In Norse mythology, Sleipnir is Odin's steed, is the child of Loki and Svaðilfari, is described as the best of all horses, and is sometimes ridden to the location of Hel.
class SampleSpec : SleipnirSpec {
var spec : () = describe("Horse") {
context("usual") {
it("is not awesome") {
let usualHorse = UsualHorse()
usualHorse.legsCount.should.equal(4)
expect(usualHorse.isAwesome()).to(beFalse())
}
}
context("Sleipnir") {
it("is awesome") {
let sleipnirHorse = Sleipnir()
sleipnirHorse.legsCount.should.equal(8)
expect(sleipnirHorse.isAwesome()).to(beTrue())
}
}
}
}
Core principles
Sleipnir is not dependent of NSObject, it is pure Swift BDD testing framework
Sleipnir is not using XCTest
Sleipnir has nice command line output and support for custom test reporters
Other features, like seeded random tests invocation, focused and excluded examples/groups, etc.
Installation
Manually (preferred way)
Add Sleipnir as a submodule: git submodule add https://github.com/railsware/sleipnir ThirdParty/Sleipnir
Drag'n'drop Sleipnir.xcodeproj to your test target
In order to run your specs you should invoke Runner.run() from the main.swift of your test target.
The default test runner will produce the following command line output, indicating all the failures and some meta information about each failure:
Running With Random Seed: 1234
.....F..
FAILURE Some spec should pass:
/Path/To/Your/Specs/TestSpec.swift:16 Expected <1> to equal <2>
Finished in 0.0075 seconds
8 examples, 1 failures
Seeded random specs run
All examples would run in random order with the random seed specified in output. If you would like to re-run tests in the same order you should pass a seed to run() method:
Runner.run(seed: 1234)
Examples and ExampleGroups
ExampleGroups are created with describe or context keywords.
Within the block passed to ExampleGroup you can declare examples using the it keyword.
ExampleGroups can be nested in order to create clean structure of your tests.
Under the hood describe method creates an instance of ExampleGroup and evaluates the block passed to it. Blocks passed to examples are evaluated dynamically during the test execution.
Setup/Teardown code
Sleipnir supports some hooks to execute before or after examples. This allows to share some setup/teardown code between examples.
beforeEach block will be executed before each example in the current group and all nested groups.
afterEach block will be executed after each example.
You can also specify global setup/teardown blocks using beforeAll and afterAll keywords.
They will run once before or after all examples in the current group and all the nested groups.
Focused and excluded specs
You can specify examples and example groups to be focused by placing f letter before declaration: fdescribe, fcontext, fit. In this case the spec runner will only run focused examples/example groups and ignore all the others.
You can also mark an example or example group as pending. It won't run but will be printed along with the test results.
To mark something as pending add an x letter before declaration: xdescribe, xcontext, xit.
Example can also be marked as pending by passing PENDING instead of spec block:
it("is pending", PENDING)
Shared example groups
Sleipnir supports extracting common specs through shared example groups.
They can include any number of it, context, describe, before and after blocks.
You can pass example-specific state into the shared example group through sharedContext dictionary.
var nonNilObject : () =
sharedExamplesFor("a non-nil object") { (sharedContext : SharedContext) in
var object: AnyObject?
beforeEach {
object = sharedContext()["object"]
}
it("should not be nil") {
expect(object).toNot(beNil())
}
}
var spec : () = context("A non-nil object") {
let someObject: String = "Some Object"
itShouldBehaveLike("a non-nil object", { ["object" : someObject] })
}
If you don't need any context, you can use closures without parameters:
railsware/Sleipnir has 840 GitHub stars — refresh the page for the live number, or check github.com/railsware/Sleipnir. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is railsware/Sleipnir open source?
TopGit's metadata for railsware/Sleipnir does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
Is railsware/Sleipnir still maintained?
TopGit's metadata for railsware/Sleipnir does not include a recent push date. Check the commit history on the GitHub repository page for the most authoritative activity timeline.
What is railsware/Sleipnir?
railsware/Sleipnir (railsware/Sleipnir) is a multi-language project tracked by TopGit. The repository has 840 GitHub stars at the time of our last sync.
What language is railsware/Sleipnir written in?
TopGit's last sync did not record a primary language for railsware/Sleipnir. Open the repository on GitHub to see the full breakdown by file extension.
Where do I read more about railsware/Sleipnir?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/railsware/Sleipnir is the definitive source.
Read full README in the tab above.
Want a second opinion on Sleipnir?
Ask an AI that can read this page — one click and you get its take on Sleipnir.