Class: Cucumberator::CurrentStep
- Inherits:
-
Object
- Object
- Cucumberator::CurrentStep
- Defined in:
- lib/cucumberator/current_step.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
- #check_for_scenario_outline! ⇒ Object
- #increase ⇒ Object
-
#initialize(environment) ⇒ CurrentStep
constructor
A new instance of CurrentStep.
- #set_line ⇒ Object
- #steps ⇒ Object
Constructor Details
#initialize(environment) ⇒ CurrentStep
Returns a new instance of CurrentStep.
7 8 9 10 11 12 |
# File 'lib/cucumberator/current_step.rb', line 7 def initialize(environment) @environment = environment @scenario_sexp = steps.to_sexp @offset = 0 set_line end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
5 6 7 |
# File 'lib/cucumberator/current_step.rb', line 5 def line @line end |
Instance Method Details
#check_for_scenario_outline! ⇒ Object
14 15 16 17 18 |
# File 'lib/cucumberator/current_step.rb', line 14 def check_for_scenario_outline! return unless @environment.respond_to?(:scenario_outline) @environment = @environment.scenario_outline end |
#increase ⇒ Object
25 26 27 28 |
# File 'lib/cucumberator/current_step.rb', line 25 def increase @offset += 1 set_line end |
#set_line ⇒ Object
30 31 32 33 |
# File 'lib/cucumberator/current_step.rb', line 30 def set_line current_sexp = @scenario_sexp[@offset] self.line = Cucumberator::StepLine.new(current_sexp[1]) if current_sexp end |
#steps ⇒ Object
20 21 22 23 |
# File 'lib/cucumberator/current_step.rb', line 20 def steps check_for_scenario_outline! @environment.instance_variable_get(:@steps) end |