Sleipnir 是 BDD 风格的 Swift 框架,灵感来源于Cedar。
示例:
class SampleSpec : SleipnirSpec { var spec : () = describe("Horse") { context("usual") { it("is not awesome") { let usualHorse = UsualHorse() expect(usualHorse.legsCount).to(equal(4)) expect(usualHorse.isAwesome()).to(beFalse()) } } context("Sleipnir") { it("is awesome") { let sleipnirHorse = Sleipnir() expect(sleipnirHorse.legsCount).to(equal(8)) expect(sleipnirHorse.isAwesome()).to(beTrue()) } } }}