Class: Cucumberator::CurrentStep

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumberator/current_step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scenario) ⇒ CurrentStep

Returns a new instance of CurrentStep.



7
8
9
10
11
# File 'lib/cucumberator/current_step.rb', line 7

def initialize(scenario)
  @scenario_sexp = scenario.steps.to_sexp
  @offset = 0
  set_line
end

Instance Attribute Details

#lineObject

Returns the value of attribute line.



5
6
7
# File 'lib/cucumberator/current_step.rb', line 5

def line
  @line
end

Instance Method Details

#increaseObject



13
14
15
16
# File 'lib/cucumberator/current_step.rb', line 13

def increase
  @offset += 1
  set_line
end

#set_lineObject



18
19
20
21
# File 'lib/cucumberator/current_step.rb', line 18

def set_line
  current_sexp = @scenario_sexp[@offset]
  self.line = Cucumberator::StepLine.new(current_sexp[1]) if current_sexp
end