Skip to content

Empty Givens? #44

Discussion options

You must be logged in to vote

I think your best bet here is to keep Gherkin as useful as possible

Given some context that does not need to execute
When I run the app
Then some testable outcome is achieved

And then have Swift code that matches your Given and simply contains no instructions:

Given("^some context that does not need to execute$") { _, _ in }

Personally, I would add all these steps to a different swift file of some kind so that they don't muddy up code. Examples of how I've gone about that can seen in #23

HOWEVER, a scenario does not need to have the keyword Given in it. You could start a scenario with When or Then because Gherkin has line-based parsing. It has some hierarchy, but not a whole lot. So if yo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexvoss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants