Class: Cucumber::Tree::BaseScenario
- Inherits:
-
Object
- Object
- Cucumber::Tree::BaseScenario
- Defined in:
- lib/cucumber/tree/scenario.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #at_line?(l) ⇒ Boolean
- #file ⇒ Object
- #pending? ⇒ Boolean
- #previous_step(step) ⇒ Object
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
4 5 6 |
# File 'lib/cucumber/tree/scenario.rb', line 4 def feature @feature end |
Instance Method Details
#accept(visitor) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/cucumber/tree/scenario.rb', line 10 def accept(visitor) steps.each do |step| if step.row? visitor.visit_row_step(step) else visitor.visit_regular_step(step) end end end |
#at_line?(l) ⇒ Boolean
20 21 22 |
# File 'lib/cucumber/tree/scenario.rb', line 20 def at_line?(l) line == l || steps.map{|s| s.line}.index(l) end |
#file ⇒ Object
6 7 8 |
# File 'lib/cucumber/tree/scenario.rb', line 6 def file @feature.file end |
#pending? ⇒ Boolean
30 31 32 |
# File 'lib/cucumber/tree/scenario.rb', line 30 def pending? steps.empty? end |
#previous_step(step) ⇒ Object
24 25 26 27 28 |
# File 'lib/cucumber/tree/scenario.rb', line 24 def previous_step(step) i = steps.index(step) raise "Couldn't find #{step} among #{steps}" if i.nil? steps[i-1] end |