class Cucumber::Runtime::SupportCode::StepInvoker

Public Class Methods

new(support_code) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 18
def initialize(support_code)
  @support_code = support_code
end

Public Instance Methods

multiline_arg(step, location) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 31
def multiline_arg(step, location)
  if argument = step[:argument]
    if argument[:type] == :DocString
      MultilineArgument.doc_string(argument[:content], argument[:content_type], location)
    else
      MultilineArgument::DataTable.from(argument[:rows].map { |row| row[:cells].map { |cell| cell[:value] } })
    end
  else
    MultilineArgument.from(nil)
  end
end
step(step) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 26
def step(step)
  location = Core::Ast::Location.of_caller
  @support_code.invoke_dynamic_step(step[:text], multiline_arg(step, location))
end
steps(steps) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 22
def steps(steps)
  steps.each { |step| step(step) }
end