From 5368ee022988186ac2f6ec6f3ac04e69c105c947 Mon Sep 17 00:00:00 2001 From: Alexandru Chitu Date: Tue, 21 Feb 2023 11:52:24 +0000 Subject: [PATCH] docs(*): correct example (#538) * docs(*): correct example * docs(*): reorder step declarations --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3e1caf..27f02d9 100644 --- a/README.md +++ b/README.md @@ -158,8 +158,8 @@ 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) } ``` @@ -167,8 +167,8 @@ func InitializeScenario(ctx *godog.ScenarioContext) { 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) } ```