Class: Cucumber::Tree::BaseScenario
- Defined in:
- lib/gems/cucumber-0.1.15/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
- #outline? ⇒ Boolean
- #pending? ⇒ Boolean
- #previous_step(step) ⇒ Object
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
4 5 6 |
# File 'lib/gems/cucumber-0.1.15/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 19 20 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/scenario.rb', line 10 def accept(visitor) steps.each do |step| if step.outline? && !step.row? visitor.visit_step_outline(step) elsif step.row? visitor.visit_row_step(step) else visitor.visit_regular_step(step) end end end |
#at_line?(l) ⇒ Boolean
22 23 24 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/scenario.rb', line 22 def at_line?(l) line == l || steps.map{|s| s.line}.index(l) end |
#file ⇒ Object
6 7 8 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/scenario.rb', line 6 def file @feature.file end |
#outline? ⇒ Boolean
36 37 38 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/scenario.rb', line 36 def outline? false end |
#pending? ⇒ Boolean
32 33 34 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/scenario.rb', line 32 def pending? steps.empty? end |
#previous_step(step) ⇒ Object
26 27 28 29 30 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/scenario.rb', line 26 def previous_step(step) i = steps.index(step) raise "Couldn't find #{step} among #{steps}" if i.nil? steps[i-1] end |