SwiftestSwift 的 BDD 测试框架
Swiftest 是 Swift 编程语言一个 BDD 风格的规范框架。
示例代码:
import Swiftest // create a class that inherits from SwiftestSuite (it's just NSObject) // and define the 'spec' member property of that class using `describe` // be sure to use `let` and not `var` here! class SampleSpec : SwiftestSuite { let spec = describe("Swiftest") { it("adds 1 + 1!") { expect(1 + 1).toEqual(2) } it("knows true from false!") { expect(true).toBeTrue() expect(true).not().toBeFalse() } example("comparing letters of the alphabet!") { expect("abc").toEqual("abc") } it("knows what stuff is NOT other stuff!") { expect(2 + 2).not().toEqual(5) } describe("arrays!") { example("special assertions for array types!") { expect([1, 2, 3]).toEqual([1, 2, 3]) expect([1, 2, 3]).toContain(1) expect([1, 2, 3]).toContain(1, 3) } } it("does nifty stuff with closures") { var a = 0 expect({ a += 1 }).toChange({ a }).to(1) expect({ a += 1 }).toChange({ a }).from(1).to(2) expect({ a += 2 }).toChange({ a }).by(2) } example("dictionaries have special assertions too!") { expect([ "key" : "val" ]).toEqual([ "key" : "val"]) expect([ "key" : "val" ]).toHaveKey("key") expect([ "key" : "val" ]).toHaveValue("val") } example("your own classes!") { // Person is a class that implements Comparable let person1 = Person(name: "Bob") let person2 = Person(name: "Alice") expect(person1).not().toEqual(person2) } } }
评论
Pho-PHPPHP 的 BDD 测试框架
Pho-PHP是PHP的BDD测试框架,它的灵感来自于Jasmine和RSpec。它有十分熟悉的语法,以及在开发中可以监控自动重启的指令。它也可以用定制的匹配器进行扩展。示例代码:Usage: pho
Pho-PHPPHP 的 BDD 测试框架
0
LightBDD轻量级 BDD 测试框架
LightBDD是一个行为驱动的开发测试框架,提供编写易于阅读、易于在执行过程中跟踪的测试能力,同时允许开发人员使用标准开发工具来维护它们。特性对重构、代码分析、测试运行以及VisualStudio/
LightBDD轻量级 BDD 测试框架
0
Machine.Specifications行为测试驱动(BDD)框架
Machine.Specifications简称 MSpec ,是一个行为测试驱动(BDD)框架,它
Machine.Specifications行为测试驱动(BDD)框架
0
Ginkgo用于 Go 的 BDD 测试框架
Ginkgo是一个BDD风格的Go测试框架,旨在帮助您有效地编写富有表现力的综合测试。它最好与Gomega匹配器库配对,但设计为与匹配器无关。Ginkgo使用Go的测试包,可以与您现有的测试工具一起使
Ginkgo用于 Go 的 BDD 测试框架
0
Machine.Specifications行为测试驱动(BDD)框架
Machine.Specifications简称MSpec,是一个行为测试驱动(BDD)框架,它本身并不是测试框架,而是在nUnit的基础上,作了一层友好性的封装。行为驱动开发(Behavior-Dr
Machine.Specifications行为测试驱动(BDD)框架
0