Class: Spinach::Feature
- Inherits:
-
Object
- Object
- Spinach::Feature
- Defined in:
- lib/spinach/feature.rb
Instance Attribute Summary collapse
-
#background ⇒ Object
Returns the value of attribute background.
-
#description ⇒ Object
Returns the value of attribute description.
-
#filename ⇒ Object
(also: #ordering_id)
Returns the value of attribute filename.
-
#lines_to_run ⇒ Object
Returns the value of attribute lines_to_run.
-
#name ⇒ Object
Returns the value of attribute name.
-
#scenarios ⇒ Object
Returns the value of attribute scenarios.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
- #background_steps ⇒ Object
-
#each_step ⇒ Object
Run the provided code for every step.
-
#initialize ⇒ Feature
constructor
A new instance of Feature.
- #run_every_scenario? ⇒ Boolean
Constructor Details
#initialize ⇒ Feature
Returns a new instance of Feature.
9 10 11 12 13 |
# File 'lib/spinach/feature.rb', line 9 def initialize @scenarios = [] @tags = [] @lines_to_run = [] end |
Instance Attribute Details
#background ⇒ Object
Returns the value of attribute background.
5 6 7 |
# File 'lib/spinach/feature.rb', line 5 def background @background end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/spinach/feature.rb', line 6 def description @description end |
#filename ⇒ Object Also known as: ordering_id
Returns the value of attribute filename.
3 4 5 |
# File 'lib/spinach/feature.rb', line 3 def filename @filename end |
#lines_to_run ⇒ Object
Returns the value of attribute lines_to_run.
7 8 9 |
# File 'lib/spinach/feature.rb', line 7 def lines_to_run @lines_to_run end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/spinach/feature.rb', line 4 def name @name end |
#scenarios ⇒ Object
Returns the value of attribute scenarios.
4 5 6 |
# File 'lib/spinach/feature.rb', line 4 def scenarios @scenarios end |
#tags ⇒ Object
Returns the value of attribute tags.
4 5 6 |
# File 'lib/spinach/feature.rb', line 4 def @tags end |
Instance Method Details
#background_steps ⇒ Object
15 16 17 |
# File 'lib/spinach/feature.rb', line 15 def background_steps @background.nil? ? [] : @background.steps end |
#each_step ⇒ Object
Run the provided code for every step
36 37 38 |
# File 'lib/spinach/feature.rb', line 36 def each_step scenarios.each { |scenario| scenario.steps.each { |step| yield step } } end |
#run_every_scenario? ⇒ Boolean
23 24 25 |
# File 'lib/spinach/feature.rb', line 23 def run_every_scenario? lines_to_run.empty? end |