Class: Cucumberator::Steps

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

Instance Method Summary collapse

Constructor Details

#initialize(scenario) ⇒ Steps

Returns a new instance of Steps.



3
4
5
# File 'lib/cucumberator/steps.rb', line 3

def initialize(scenario)
  @scenario = scenario
end

Instance Method Details

#allObject



7
8
9
# File 'lib/cucumberator/steps.rb', line 7

def all
  @steps ||= all_defined_steps
end

#all_defined_stepsObject



11
12
13
14
# File 'lib/cucumberator/steps.rb', line 11

def all_defined_steps
  support_code = current_visitor.runtime.instance_variable_get("@support_code")
  support_code.step_definitions.map { |sd| sd.regexp_source }
end

#current_visitorObject



16
17
18
# File 'lib/cucumberator/steps.rb', line 16

def current_visitor
  @current_visitor ||= @scenario.instance_variable_get("@current_visitor")
end