cucumber-attic / gherkin2

A fast Gherkin parser in Ragel (The parser behind Cucumber)
MIT License
381 stars 220 forks source link

Doc strings and data tables edge cases #138

Open jbpros opened 13 years ago

jbpros commented 13 years ago

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.

aslakhellesoy commented 13 years ago

Have you verified this with the ruby parser?

jbpros commented 13 years ago

This was tested with Cucumber ruby (1.1.0).