Skip to content

Commit

Permalink
docs(*): correct example (#538)
Browse files Browse the repository at this point in the history
* docs(*): correct example

* docs(*): reorder step declarations
  • Loading branch information
Alexandru Chitu committed Feb 21, 2023
1 parent 62d84ee commit 5368ee0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -158,17 +158,17 @@ func thereShouldBeRemaining(arg1 int) error {
}

func InitializeScenario(ctx *godog.ScenarioContext) {
ctx.Step(`^I eat (\d+)$`, iEat)
ctx.Step(`^there are (\d+) godogs$`, thereAreGodogs)
ctx.Step(`^I eat (\d+)$`, iEat)
ctx.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)
}
```

Alternatively, you can also specify the keyword (Given, When, Then...) when creating the step definitions:
``` go
func InitializeScenario(ctx *godog.ScenarioContext) {
ctx.Given(`^I eat (\d+)$`, iEat)
ctx.When(`^there are (\d+) godogs$`, thereAreGodogs)
ctx.Given(`^there are (\d+) godogs$`, thereAreGodogs)
ctx.When(`^I eat (\d+)$`, iEat)
ctx.Then(`^there should be (\d+) remaining$`, thereShouldBeRemaining)
}
```
Expand Down

0 comments on commit 5368ee0

Please sign in to comment.