From 7dbacfa3988aae0ac60f09f5684bc70f740d7428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Tue, 13 Oct 2020 19:42:52 +0200 Subject: [PATCH 1/2] Added a comment regarding running the examples within the GOPATH --- README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9f180015..328d3c2f 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,17 @@ Join [here](https://cucumberbdd-slack-invite.herokuapp.com/). - [#committers-go](https://cucumberbdd.slack.com/archives/CA5NJPDJ4) - Golang focused Cucumber Contributors - [#committers](https://cucumberbdd.slack.com/archives/C62D0FK0E) - General Cucumber Contributors -## Example +## Examples + +You can find a few examples [here](/_examples). + +**Note** that if you want to execute any of the examples and have the GIT repository checked out in the `$GOPATH`, you need to use: `GO111MODULE=off`. [Issue](https://github.com/cucumber/godog/issues/344) for reference. + +### Godogs The following example can be [found here](/_examples/godogs). -### Step 1 - Setup a go module +#### Step 1 - Setup a go module Given we create a new go module **godogs** in your normal go workspace. - `mkdir godogs` @@ -80,11 +86,11 @@ From now on, this is our work directory - `cd godogs` Initiate the go module - `go mod init godogs` -### Step 2 - Install godog +#### Step 2 - Install godog Install the godog binary - `go get github.com/cucumber/godog/cmd/godog` -### Step 3 - Create gherkin feature +#### Step 3 - Create gherkin feature Imagine we have a **godog cart** to serve godogs for lunch. @@ -102,7 +108,7 @@ Feature: eat godogs Then there should be 7 remaining ``` -### Step 4 - Create godog step definitions +#### Step 4 - Create godog step definitions **NOTE:** same as **go test** godog respects package level isolation. All your step definitions should be in your tested package root directory. In this case: **godogs**. @@ -202,7 +208,7 @@ Feature: eat godogs You may change **return godog.ErrPending** to **return nil** in the three step definitions and the scenario will pass successfully. -### Step 5 - Create the main program to test +#### Step 5 - Create the main program to test We only need a number of **godogs** for now. Lets keep it simple. @@ -227,7 +233,7 @@ godogs - godogs_test.go ``` -### Step 6 - Add some logic to the step defintions +#### Step 6 - Add some logic to the step defintions Now lets implement our step definitions to test our feature requirements: @@ -301,7 +307,7 @@ By now, you should have figured out, how to use **godog**. Another advice is to When steps are orthogonal and small, you can combine them just like you do with Unix tools. Look how to simplify or remove ones, which can be composed. -### References and Tutorials +## References and Tutorials - [cucumber-html-reporter](https://github.com/gkushang/cucumber-html-reporter), may be used in order to generate **html** reports together with **cucumber** output formatter. See the [following docker image](https://github.com/myie/cucumber-html-reporter) for usage details. @@ -310,7 +316,7 @@ When steps are orthogonal and small, you can combine them just like you do with - see extension [AssistDog](https://github.com/hellomd/assistdog), which may have useful **gherkin.DataTable** transformations or comparison methods for assertions. -### Documentation +## Documentation See [pkg documentation][godoc] for general API details. See **[Circle Config](/.circleci/config.yml)** for supported **go** versions. From 6588187c3e73e96239e7886c6ce0cf27153e7499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Wed, 14 Oct 2020 08:38:40 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 328d3c2f..5377dc47 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Join [here](https://cucumberbdd-slack-invite.herokuapp.com/). You can find a few examples [here](/_examples). -**Note** that if you want to execute any of the examples and have the GIT repository checked out in the `$GOPATH`, you need to use: `GO111MODULE=off`. [Issue](https://github.com/cucumber/godog/issues/344) for reference. +**Note** that if you want to execute any of the examples and have the Git repository checked out in the `$GOPATH`, you need to use: `GO111MODULE=off`. [Issue](https://github.com/cucumber/godog/issues/344) for reference. ### Godogs