cucumber-attic/gherkin2

Doc strings and data tables edge cases

Opened this issue · 2 comments

Consider the following scenario:

Feature:
  Scenario: one step with a doc string AND a data table
    Given the following things:
      """
      This is a doc string
      """
      | and | this | is    |
      | a   | data | table |
    Given some other step

Running Cucumber against it will display:

Feature: 

  Scenario: one step with a doc string AND a data table # features/test.feature:2
    Given the following things:                         # features/test.feature:3
      """
      This is a doc string
      """
    Given some other step                               # features/test.feature:9
      | and | this | is    |
      | a   | data | table |

I would have expected Gherkin's parser to throw an exception on this. And Cucumber should certainly not pass the data table to the second step.

Also:

Feature:
  Scenario: several doc strings passed to one step
    Given the following strings:
      """
      This is the first string
      """
      """
      This is the second string
      """

Outputs:

Feature: 

  Scenario: several doc strings passed to one step # features/test.feature:2
    Given the following strings:                   # features/test.feature:3
      """
      This is the second string
      """

Same goes here; Gherkin should yell at me.

Have you verified this with the ruby parser?

This was tested with Cucumber ruby (1.1.0).