Skip to content

Instantly share code, notes, and snippets.

@eee-c
Created June 4, 2010 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eee-c/424863 to your computer and use it in GitHub Desktop.
Save eee-c/424863 to your computer and use it in GitHub Desktop.
diff --git a/lib/cucumber/js_support/js_language.rb b/lib/cucumber/js_support/js_language.rb
index 06ced38..c1e858f 100644
--- a/lib/cucumber/js_support/js_language.rb
+++ b/lib/cucumber/js_support/js_language.rb
@@ -24,7 +24,7 @@ module Cucumber
end
end
- @world.eval("(#{js_function.ToString})(#{js_args.join(',')});")
+ @world.eval("(#{js_function.to_s})(#{js_args.join(',')});")
end
def method_missing(method_name, *args)
@@ -34,7 +34,7 @@ module Cucumber
class JsStepDefinition
def initialize(js_language, regexp, js_function)
- @js_language, @regexp, @js_function = js_language, regexp.ToString, js_function
+ @js_language, @regexp, @js_function = js_language, regexp.to_s, js_function
end
def invoke(args)
@@ -45,7 +45,7 @@ module Cucumber
def arguments_from(step_name)
matches = eval_js "#{@regexp}.exec('#{step_name}')"
if matches
- matches[1..-1].map do |match|
+ matches.to_a[1..-1].map do |match|
JsArg.new(match)
end
end
@@ -73,7 +73,7 @@ module Cucumber
class JsTransform
def initialize(js_language, regexp, js_function)
- @js_language, @regexp, @js_function = js_language, regexp.ToString, js_function
+ @js_language, @regexp, @js_function = js_language, regexp.to_s, js_function
end
def match(arg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment