cucumber / docs

Cucumber user documentation
https://cucumber.io/docs/installation/
MIT License
151 stars 528 forks source link

Unclear whether a Rule can contain a Background or not #344

Closed jfhector closed 5 years ago

jfhector commented 5 years ago

The explanation of Rule says that: "A Rule cannot contain a Background."

This sentence is followed by an example where a Rule contains a Background.

# -- FILE: features/gherkin.rule_example.feature
Feature: Highlander

  Rule: There can be only One

    Background:
      Given there are 3 ninjas

    Example: Only One -- More than one alive
      Given there are more than one ninjas alive
      When 2 ninjas meet, they will fight
      Then one ninja dies (but not me)
      And there is one ninja less alive

This leaves me confused about whether a Rule can contain a Background or not.

--

As an aside: The docs are great. Thanks for your beautiful work.

mlvandijk commented 5 years ago

Hi @jfhector - thanks for pointing that out!

To answer your question: It is not possible to use a Background in a Rule, so the example should be updated (the Background should be removed from the example). Do you think this is a change you could do yourself?

I'm glad to hear you appreciate the docs & our work on them. Help is always very welcome!

jfhector commented 5 years ago

Thanks. I've just created a pull request: https://github.com/cucumber/docs.cucumber.io/pull/346

mlvandijk commented 5 years ago

Closed by #346