dkornishev / dherkin

Cucumber gherkin runtime for dart
BSD 2-Clause "Simplified" License
8 stars 5 forks source link

More meaningful specs for dherkin #20

Open Goutte opened 10 years ago

Goutte commented 10 years ago
Feature: Specs
  In order to test the runner's output
  As dherkin developers
  We should have a gherkin feature for it.

The only non-deterministic part of the output is in the error trace, which holds absolute filepaths. Still, we can glob or regex it and check that the rest is as expected.

For 80-chars width alignment and other things, it will prove useful.

Goutte commented 10 years ago

Following that spirit, I added :

Feature: Supporting Backgrounds and Comments

  # Note: inlined comments are not supported in gherkin.

  # Backgrounds are written to buffer only once,
  # but executed once per scenario (outline example).

  Background:
    Given I have a background setting a variable to a default value

  Scenario: First Scenario
    Given I set the background-setup variable to a different value
     Then the background-setup variable should hold the different value

  Scenario: Second Scenario
    Given this scenario has ran the background first
     Then the background-setup variable should hold the default value

  Scenario Outline: With each example of an outline
    Given this scenario outline example has ran the background first
     Then the background-setup variable should hold the default value
      And I set the background-setup variable to a different value
  Examples:
    |col1|col2 |
    |imus|nocte|
    |igni|genus|

# Scenario: Commented Scenario
#   Given this is a commented scenario
#    Then this step should never run