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::Feature
s.
Required Methods
sourcefn expand_examples(self) -> Result<Self, ExpandExamplesError>
fn expand_examples(self) -> Result<Self, ExpandExamplesError>
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.