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
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#orderer ⇒ Object
readonly
Returns the value of attribute orderer.
Instance Method Summary collapse
-
#feature_name ⇒ String
This feature name.
-
#initialize(feature, orderer: Spinach::Orderers::Default.new) ⇒ FeatureRunner
constructor
A new instance of FeatureRunner.
-
#run ⇒ true, false
Runs this feature.
-
#scenarios ⇒ Array<GherkinRuby::AST::Scenario>
The parsed scenarios for this runner’s feature.
Constructor Details
#initialize(feature, orderer: Spinach::Orderers::Default.new) ⇒ FeatureRunner
Returns a new instance of FeatureRunner.
15 16 17 18 |
# File 'lib/spinach/runner/feature_runner.rb', line 15 def initialize(feature, orderer: Spinach::Orderers::Default.new) @feature = feature @orderer = orderer end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
9 10 11 |
# File 'lib/spinach/runner/feature_runner.rb', line 9 def feature @feature end |
#orderer ⇒ Object (readonly)
Returns the value of attribute orderer.
9 10 11 |
# File 'lib/spinach/runner/feature_runner.rb', line 9 def orderer @orderer end |
Instance Method Details
#feature_name ⇒ String
Returns This feature name.
24 25 26 |
# File 'lib/spinach/runner/feature_runner.rb', line 24 def feature_name feature.name end |
#run ⇒ true, false
Runs this feature.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/spinach/runner/feature_runner.rb', line 42 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) # FIXME The feature & scenario runners should have the same structure. # They should either both return inverted failure or both return # raw success. !@failed end |
#scenarios ⇒ Array<GherkinRuby::AST::Scenario>
Returns The parsed scenarios for this runner’s feature.
32 33 34 |
# File 'lib/spinach/runner/feature_runner.rb', line 32 def scenarios feature.scenarios end |