class Cucumber::Tcl::StepDefinitions

Public Class Methods

new(tcl_framework) click to toggle source
# File lib/cucumber/tcl/step_definitions.rb, line 8
def initialize(tcl_framework)
  @tcl_framework = tcl_framework
end

Public Instance Methods

attempt_to_activate(test_step) click to toggle source
# File lib/cucumber/tcl/step_definitions.rb, line 12
def attempt_to_activate(test_step)
  return test_step unless match?(test_step)
  test_step.with_action &action_for(test_step)
end

Private Instance Methods

action_for(test_step) click to toggle source
# File lib/cucumber/tcl/step_definitions.rb, line 23
def action_for(test_step)
  arguments = ArgumentList.new(test_step)
  proc { 
    response = ExecuteResponse.new(@tcl_framework.execute_step_definition(*arguments))
    response.raise_any_pending_error
  }
end
match?(test_step) click to toggle source
# File lib/cucumber/tcl/step_definitions.rb, line 19
def match?(test_step)
  @tcl_framework.step_definition_exists?(test_step.name)
end