https://github.com/lvnkmn/quickgwt
Simply adds Given When and Then to Quick.
https://github.com/lvnkmn/quickgwt
bdd cucumber gherkin given quick swift then when
Last synced: about 2 months ago
JSON representation
Simply adds Given When and Then to Quick.
- Host: GitHub
- URL: https://github.com/lvnkmn/quickgwt
- Owner: lvnkmn
- License: mit
- Created: 2018-05-27T18:37:10.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2019-05-07T14:38:31.000Z (almost 6 years ago)
- Last Synced: 2025-01-20T09:32:13.698Z (3 months ago)
- Topics: bdd, cucumber, gherkin, given, quick, swift, then, when
- Language: Swift
- Homepage:
- Size: 270 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QuickGWT
[](http://cocoapods.org/pods/Zoomy) [](http://cocoapods.org/pods/Zoomy) [](LICENSE)
## Example
To see the example project, run the following in your terminal:
`pod try QuickGWT `
## Setup
Just add:
```Swift
import QuickGWT
```to the files where you'd like to use `given`, `when` and `then`.
## Usage
Considering you're already using Quick and Nimble:
```Swift
given("A viewController") {
var sut: ViewController!
beforeEach {
sut = ViewController()
}
when("viewDidLoad") {beforeEach {
sut.viewDidLoad()
}then("title is set") {
expect(sut.title).to(equal("Expected Title"))
}then("backgroundColor is set") {
expect(sut.view.backgroundColor).to(equal(UIColor.white))
}
}
}
```
The test results will look like this:
## Some background
* All this lib contains is four functions
* You can see them [here](https://github.com/mennolovink/QuickGWT/blob/develop/QuickGWT/Classes/GivenWhenThen.swift)
* `given` is an alternative to Quick's `describe` function
* `when` is an alternative to Quick's `context` function
* `and` is (also) an alternative to Quick's `context` function
* `then` is an alternative to Quick's `it` function
* You can always mix up these added functions with Quick's existing `describe`, `context` and `it` functions## Installation
### CocoaPods
QuickGWT is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'QuickGWT'
```
You'd propably going to want this in your test target(s) only.### Adding the code manually
Considering the meat of this lib is only one file containing 4 functions, you could also just copy over [GivenWhenThen.swift](https://github.com/mennolovink/QuickGWT/blob/develop/QuickGWT/Classes/GivenWhenThen.swift) to your project/workspace. Don't forget to make sure the file is part of your test target(s).## License
QuickGWT is available under the MIT license. See the LICENSE file for more info.