class Cucumber::JsSupport::JsStepDefinition

Public Class Methods

new(js_language, regexp, js_function) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 33
def initialize(js_language, regexp, js_function)
  @js_language, @regexp, @js_function = js_language, regexp.to_s, js_function
end

Public Instance Methods

arguments_from(step_name) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 46
def arguments_from(step_name)
  matches = eval_js "#{@regexp}.exec('#{step_name}')"
  if matches
    matches.to_a[1..-1].map do |match|
      JsArg.new(match)
    end
  end
end
file_colon_line() click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 55
def file_colon_line
  # Not possible yet to get file/line of js function with V8/therubyracer
  ""
end
invoke(args) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 37
def invoke(args)
  args = @js_language.execute_transforms(args)
  @js_language.current_world.execute(@js_function, args)
end
regexp_source() click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 42
def regexp_source
  @regexp.inspect
end