Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Gherkin 6 (Con't) #208

Merged
merged 6 commits into from
Feb 27, 2019
Merged

Support Gherkin 6 (Con't) #208

merged 6 commits into from
Feb 27, 2019

Conversation

gongo
Copy link
Collaborator

@gongo gongo commented Feb 27, 2019

🍕 Motivation

💪 Did

Support Rule keyword.

Feature: Gherkin 6 syntax

  Background:
    Given there is a monster with 2 hitpoints

  Scenario: Battle
    When I attack it
    Then the monster should be alive
    When I attack it
    Then it should die

  Rule: Battle with preemptive attack
    Background:
      Given I attack the monster and do 1 points damage

    Example: battle
      When I attack it
      Then it should die

  Rule: Battle with preemptive critical attack
    Background:
      Given I attack the monster and do 2 points damage

    Example: battle
      Then it should die

image

👀 References

# children: [] # Array of Background, Scenario and Scenario Outline
# }
#
class Rule < ScenarioGroupDefinition
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule has no Tag. ( see: gherkin.berp )

@gongo
Copy link
Collaborator Author

gongo commented Feb 27, 2019

📝 Note

Running the following test will fail 😭

+++ b/examples/gherkin6_syntax.feature
@@ -3,12 +3,6 @@ Feature: Gherkin 6 syntax
   Background:
     Given there is a monster with 2 hitpoints

-  Scenario: Battle
-    When I attack it
-    Then the monster should be alive
-    When I attack it
-    Then it should die
-
   Rule: Battle with preemptive attack
     Background:
       Given I attack the monster and do 1 points damage
@@ -23,3 +17,9 @@ Feature: Gherkin 6 syntax

     Example: battle
       Then it should die
+
+  Scenario: Battle
+    When I attack it
+    Then the monster should be alive
+    When I attack it
+    Then it should die

image

Because Scenario after Rule is handled under Rule, even though indentation is the same level as Rule.

real scenario scenario recognized by gherkin
image image

@gongo gongo merged commit 65151cc into master Feb 27, 2019
@gongo gongo deleted the support_gherkin6 branch February 27, 2019 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant