-
Notifications
You must be signed in to change notification settings - Fork 1
/
QuickExample.swift
32 lines (27 loc) · 1.07 KB
/
QuickExample.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import XCTest
import Quick
import Tablier
@testable import Example
/// Example with Quick
final class QuickTests: QuickSpec {
override func spec() {
describe("pluralize") {
let recipe = Recipe<String, String>(sync: { input in
return try pluralize(word: input)
})
// `it` should be outside of `recipe.assert`
it("should return correct plurals") {
recipe.assert(with: self) { t in
t.when("apple").expect("apples")
t.when("banana").expect("bananas")
t.when("chocolate").expect("chocolates")
t.when("leaf").expect("leaves").withDescription("end with -f")
t.when("knife").expect("knives").withDescription("end with -fe")
t.when("tomato").expect("tomatoes").withDescription("end with -o")
// Remove omit() to see how it fails
t.when("foot").expect("feet").withDescription("irregular one").omit()
}
}
}
}
}