Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mangofever/ios-gherkin
Gherkin Syntax Sugar for iOS based on Quick
https://github.com/mangofever/ios-gherkin
bdd-style cucumber gherkin ios-bdd ios-test tdd
Last synced: 6 days ago
JSON representation
Gherkin Syntax Sugar for iOS based on Quick
- Host: GitHub
- URL: https://github.com/mangofever/ios-gherkin
- Owner: mangofever
- License: mit
- Created: 2020-03-04T06:48:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T08:58:49.000Z (over 4 years ago)
- Last Synced: 2024-12-16T01:46:08.814Z (6 days ago)
- Topics: bdd-style, cucumber, gherkin, ios-bdd, ios-test, tdd
- Language: Swift
- Homepage:
- Size: 22.5 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS-Gherkin
iOS-Gherkin is a library wrapping Quick (https://github.com/Quick/Quick)
With Quick:
```
class AdderSpec: QuickSpec {
override func spec() {
describe("Adder") {
var adder: Adder!
beforeEach {
adder = WeirdAdder()
}context("max value is 20") {
beforeEach {
adder.maxValue = 20
}context("add 10") {
beforeEach {
adder.add(10)
}context("add 6") {
beforeEach {
adder.add(6)
}context("add 2") {
beforeEach {
adder.add(2)
}context("add 1") {
beforeEach {
adder.add(2)
}
context("add 3") {
beforeEach {
adder.add(3)
}
it("result is 20") {
expect(adder.result).to(equal(20))
}
}
}
}
}
}
}
}
}
} // so many }}}}}}}
```With Gherkin:
```
class AdderSpec: GherkinSpec {
override func spec() {
Feature("add") {
var adder: Adder!
Background {
adder = Adder()
}Scenario("add over max value") {
Given("max value is 20") {
adder.maxValue = 20
}
When("add 10") {
adder.add(10)
}
When("add 6") {
adder.add(6)
}
When("add 2") {
adder.add(2)
}
When("add 1") {
adder.add(1)
}
When("add 3") {
adder.add(3)
}Then("result is 20") {
expect(adder.result).to(equal(20))
}
}
}
}
}
```## Benefits
1. less '}'s.
2. more specific context keywords (Given, When, Then).
3. no ```beforeEach``` needed.Keywords are from Cucumber(https://cucumber.io/docs/gherkin/).
## Install
### Cocoapods
```
pod 'Gherkin'
```Please give feedbacks to improve iOS-Gherkin. Thank you!