Skip to content

Commit

Permalink
feat: run rules
Browse files Browse the repository at this point in the history
  • Loading branch information
vlalanne committed May 3, 2024
1 parent 39e9e76 commit 3f08c95
Show file tree
Hide file tree
Showing 14 changed files with 204 additions and 103 deletions.
2 changes: 1 addition & 1 deletion context/context.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package context

import (
"github.com/go-bdd/gobdd"
gobdd "github.com/go-bdd/gobdd"
)

// Holds data from previously executed steps
Expand Down
40 changes: 21 additions & 19 deletions context_get.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 21 additions & 19 deletions context_get_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions features/background.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ Feature: using background steps

Scenario: the background step should be executed
Then the result should equal 3

Rule: adding and concat
Background: concat
When I concat word Hello and text " World!"

Scenario: the background steps should be executed
Then the result should equal 3
Then the result should equal text "Hello World!"
1 change: 1 addition & 0 deletions features/example.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Feature: math operations
Scenario: add two digits
When I add 1 and 2
Then the result should equal 3

6 changes: 6 additions & 0 deletions features/example_rule.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: math operations
Rule: add things
Scenario: add two digits
When I add 1 and 2
Then the result should equal 3

9 changes: 9 additions & 0 deletions features/ignored_rule_tags.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Feature: ignored tags
@ignore
Rule: this rule should be ignored
Scenario: the scenario should be ignored
Then fail the test
Rule: this rule should run
Scenario: the scenario should pass
Then the test should pass
2 changes: 2 additions & 0 deletions features/ignored_tags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Feature: ignored tags
@ignore
Scenario: the scenario should be ignored
Then fail the test
Scenario: the scenario should pass
Then the test should pass
13 changes: 12 additions & 1 deletion features/tags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ Feature: ignored tags
Then the test should pass
Examples:
Scenario: the test should never be executed
Then fail the test
Then fail the test

Rule: the rule should never be executed
Scenario: the test in ignored rule should never be executed
Then fail the test

Rule: this rule should run
@tag
Scenario: the test in executed rule should pass
Then the test should pass
Scenario: the test in executed rule should never be executed
Then fail the test
13 changes: 10 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ go 1.17

require (
github.com/cucumber/gherkin/go/v28 v28.0.0
github.com/cucumber/messages/go/v24 v24.0.1
github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d
github.com/cucumber/messages/go/v24 v24.1.0
github.com/go-bdd/assert v0.0.0-20200713105154-236f01430281
github.com/stretchr/testify v1.9.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/stretchr/testify v1.8.4
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 3f08c95

Please sign in to comment.