讓我給你講講 iOS 自動化測試的那些干貨(11)
發表于:2017-03-10來源:csdn作者:LeoMobileDeveloper點擊數:
標簽:iOS
Quick是建立在 XCTestSuite 上的框架,使用 XCTestSuite 允許你動態創建測試用例。所以,使用Quick,你仍讓可以使用XCode的測試相關GUI和命令行工具。 使用Quick編寫
Quick是建立在XCTestSuite上的框架,使用XCTestSuite允許你動態創建測試用例。所以,使用Quick,你仍讓可以使用XCode的測試相關GUI和命令行工具。
使用Quick編寫的測試用例看起來是這樣子的:
import Quick
import Nimble
class TableOfContentsSpec: QuickSpec {
override func spec() {
describe("the 'Documentation' directory") {
it("has everything you need to get started") {
let sections = Directory("Documentation").sections
expect(sections).to(contain("Organized Tests with Quick Examples and Example Groups"))
expect(sections).to(contain("Installing Quick"))
}
context("if it doesn't have what you're looking for") {
it("needs to be updated") {
let you = You(awesome: true)
expect{you.submittedAnIssue}.toEventually(beTruthy())
}
}
}
}
}