Trait cucumber::feature::Ext

source ·
pub trait Ext: Sized + Sealed {
    fn expand_examples(self) -> Result<Self, ExpandExamplesError>;
    fn count_scenarios(&self) -> usize;
    fn count_steps(&self) -> usize;
}
Expand description

Helper methods to operate on gherkin::Features.

Required Methods

Expands Scenario Outline Examples.

So this one:

Feature: Hungry
  Scenario Outline: eating
    Given there are <start> cucumbers
    When I eat <eat> cucumbers
    Then I should have <left> cucumbers
    And substitution in tables works too
     | cucumbers left |
     | <left>         |

    Examples:
      | start | eat | left |
      |    12 |   5 |    7 |
      |    20 |   4 |   16 |

Will be expanded as:

Feature: Hungry
  Scenario Outline: eating
    Given there are 12 cucumbers
    When I eat 5 cucumbers
    Then I should have 7 cucumbers
    And substitution in tables works too
     | cucumbers left |
     | 7              |
  Scenario Outline: eating
    Given there are 20 cucumbers
    When I eat 4 cucumbers
    Then I should have 16 cucumbers
    And substitution in tables works too
     | cucumbers left |
     | 7              |

    Examples:
      | start | eat | left |
      |    12 |   5 |    7 |
      |    20 |   4 |   16 |
Errors

Errors if the Examples cannot be expanded. See ExpandExamplesError for details.

Counts all the Feature’s Scenarios, including Rules inside.

Counts all the Feature’s Steps.

Implementations on Foreign Types

Implementors