Skip to content

Commit 5368ee0

Browse files
author
Alexandru Chitu
authored
docs(*): correct example (#538)
* docs(*): correct example * docs(*): reorder step declarations
1 parent 62d84ee commit 5368ee0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,17 @@ func thereShouldBeRemaining(arg1 int) error {
158158
}
159159

160160
func InitializeScenario(ctx *godog.ScenarioContext) {
161-
ctx.Step(`^I eat (\d+)$`, iEat)
162161
ctx.Step(`^there are (\d+) godogs$`, thereAreGodogs)
162+
ctx.Step(`^I eat (\d+)$`, iEat)
163163
ctx.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)
164164
}
165165
```
166166

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

0 commit comments

Comments
 (0)