- 授权协议: 未知
- 开发语言: Swift
- 操作系统: OS X
- 软件首页: https://github.com/bppr/Swiftest
软件介绍
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)
}
}
}
Java 语言导学
Mary Campione Kalrath Alison Huml / 机械工业 / 2003-1 / 39.00元
《Java 语言导学(原书第3版)》既适合初学者,也适合有经验的程序员:新程序员通过从头到尾阅读《Java 语言导学(原书第3版)》可以得到最大的收获,包括按照第1章“起步”中的步骤说明编译和运行自己的第一个程序。有过程式语言(比如C)经验的程序员可能希望从Java编程语言的面向对象概念和特性开始学习。 有面向对象编程经验的程序员可能希望先学习更高级的内容。一起来看看 《Java 语言导学》 这本书的介绍吧!
CSS 压缩/解压工具
在线压缩/解压 CSS 代码
JSON 在线解析
在线 JSON 格式化工具
