diff --git a/CHANGELOG.md b/CHANGELOG.md index acdb80e..9e6b326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt - Run godog features in CircleCI in strict mode ([jaysonesmith]) - Removed TestMain call in `suite_test.go` for CI. ([jaysonesmith]) +- Migrated to [gherkin-go - v9.2.0](https://github.com/cucumber/gherkin-go/releases/tag/v9.2.0). ([240](https://github.com/cucumber/godog/pull/240) - [lonnblad]) ### Deprecated diff --git a/README.md b/README.md index 72f7dc8..0c8c78a 100644 --- a/README.md +++ b/README.md @@ -149,11 +149,36 @@ console output snippets in order to test our feature requirements: package main import ( + "flag" "fmt" + "os" + "testing" "github.com/cucumber/godog" + "github.com/cucumber/godog/colors" + messages "github.com/cucumber/messages-go/v9" ) +var opt = godog.Options{Output: colors.Colored(os.Stdout)} + +func init() { + godog.BindFlags("godog.", flag.CommandLine, &opt) +} + +func TestMain(m *testing.M) { + flag.Parse() + opt.Paths = flag.Args() + + status := godog.RunWithOptions("godogs", func(s *godog.Suite) { + FeatureContext(s) + }, opt) + + if st := m.Run(); st > status { + status = st + } + os.Exit(status) +} + func thereAreGodogs(available int) error { Godogs = available return nil @@ -179,7 +204,7 @@ func FeatureContext(s *godog.Suite) { s.Step(`^I eat (\d+)$`, iEat) s.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining) - s.BeforeScenario(func(interface{}) { + s.BeforeScenario(func(*messages.Pickle) { Godogs = 0 // clean the state before every scenario }) } @@ -373,9 +398,8 @@ Join [here](https://cucumberbdd-slack-invite.herokuapp.com/). - [#committers](https://cucumberbdd.slack.com/archives/C62D0FK0E) - General Cucumber Contributors ## License - -**Godog** is licensed under the [MIT][license] -**Gherkin** is licensed under the [MIT][license] and developed as +- **Godog** is licensed under the [MIT][license] +- **Gherkin** is licensed under the [MIT][license] and developed as a part of the [cucumber project][cucumber] [godoc]: http://godoc.org/github.com/cucumber/godog "Documentation on godoc"