Class: Spinach::Runner::FeatureRunner
- Inherits:
-
Object
- Object
- Spinach::Runner::FeatureRunner
- Defined in:
- lib/spinach/runner/feature_runner.rb
Overview
A feature runner handles a particular feature run.
Instance Attribute Summary (collapse)
-
- (Object) feature
readonly
Returns the value of attribute feature.
Instance Method Summary (collapse)
-
- (String) feature_name
This feature name.
-
- (FeatureRunner) initialize(feature, line = nil)
constructor
A new instance of FeatureRunner.
-
- (true, false) run
Runs this feature.
-
- (Array<Gherkin::AST::Scenario>) scenarios
The parsed scenarios for this runner's feature.
Constructor Details
- (FeatureRunner) initialize(feature, line = nil)
A new instance of FeatureRunner
18 19 20 21 |
# File 'lib/spinach/runner/feature_runner.rb', line 18 def initialize(feature, line=nil) @feature = feature @line = line.to_i if line end |
Instance Attribute Details
- (Object) feature (readonly)
Returns the value of attribute feature
8 9 10 |
# File 'lib/spinach/runner/feature_runner.rb', line 8 def feature @feature end |
Instance Method Details
- (String) feature_name
This feature name.
27 28 29 |
# File 'lib/spinach/runner/feature_runner.rb', line 27 def feature_name @feature.name end |
- (true, false) run
Runs this feature.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/spinach/runner/feature_runner.rb', line 45 def run Spinach.hooks.run_before_feature @feature if Spinach.find_step_definitions(feature_name) run_scenarios! else undefined_steps! end Spinach.hooks.run_after_feature @feature !@failed end |
- (Array<Gherkin::AST::Scenario>) scenarios
The parsed scenarios for this runner's feature.
35 36 37 |
# File 'lib/spinach/runner/feature_runner.rb', line 35 def scenarios @feature.scenarios end |