Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

undefined method 'ToString' when trying to run cucumber #23

Closed
coreyhaines opened this issue May 25, 2010 · 11 comments
Closed

undefined method 'ToString' when trying to run cucumber #23

coreyhaines opened this issue May 25, 2010 · 11 comments

Comments

@coreyhaines
Copy link

Probably should put this in the cucumber issues list, as well, but I know you guys are working closely together. I just upgraded therubyracer and I get this error when I try to run cucumber (stack trace below). Thoughts? My scenarios were running before.

undefined method ToString' for #<V8::Object:0x10034c7d0 @native=#<V8::C::Object:0x10034d720>> (NoMethodError) /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/js_support/js_language.rb:37:ininitialize'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/js_support/js_language.rb:140:in new' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/js_support/js_language.rb:140:inadd_step_definition'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/to.rb:39:in call' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/to.rb:39 /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:29:incall'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:29:in Run' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:29:ineval'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:108:in enter' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:24:ineval'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:23:in try' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:23:ineval'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:43:in evaluate' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:48:inload'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:47:in open' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/therubyracer-0.7.0/lib/v8/context.rb:47:inload'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/js_support/js_language.rb:31:in send' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/js_support/js_language.rb:31:inmethod_missing'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/js_support/js_language.rb:117:in load_code_file' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/step_mother.rb:84:inload_code_file'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/step_mother.rb:76:in load_code_files' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/step_mother.rb:75:ineach'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/step_mother.rb:75:in load_code_files' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/cli/main.rb:56:inexecute!'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/../lib/cucumber/cli/main.rb:25:in execute' /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/cucumber:8 /Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/bin/cucumber:19:inload'
/Users/coreyhaines/.rvm/gems/ruby-1.8.7-p249/bin/cucumber:19

@coreyhaines
Copy link
Author

Wow, that came out ugly. Here's a gist of the trace: http://gist.github.com/413405

You can check out the 'coffee' branch on my repo to see what I'm running: github.com/coreyhaines/purely_functional_data_structures

@cowboyd
Copy link
Collaborator

cowboyd commented May 25, 2010

Hmm.. There was a bug in the to_s method of V8::Object, and so I bet that the cucumber support was working around it by calling the native V8 method ToString() (you can tell native V8 methods because they are PascalCase). I fixed that bug in between 0.6.3 and 0.7.0, so probably need to fix the cucumber. I'll verify though.

In other words, the fix broke the workaround.
thanks!

@coreyhaines
Copy link
Author

Cool, thanks. I was wondering what was up with the Pascal casing. My head was thinking java, for some reason.

I actually looked at my code to see if I was pascal-casing it. Nope. Phew!

Thanks.

@cowboyd
Copy link
Collaborator

cowboyd commented May 25, 2010

Yep. That's definitely the case. You can probably work around it by subsituting all the ToString() calls to to_s()
I'm going to propose a set of fixes for cucumber, but in the mean time...

@cowboyd
Copy link
Collaborator

cowboyd commented May 26, 2010

Corey,

I got your tests passing by patching cucumber.... and they ran in less than .5s!
cowboyd/cucumber@325d0fb03d876ede6a10e687fd1a5b57e7848919

Also, be sure to grab the latest racer code.

cheers,
Charles

@coreyhaines
Copy link
Author

Awesome! Thanks. I'll grab that and try it out tonight. The timing sounds wonderful, too.

@coreyhaines
Copy link
Author

Hmm... The link to the commit takes me to octokitty.

@coreyhaines
Copy link
Author

I'll pull cucumber from your fork and try it out. (wow, that sentence is awesome)

@coreyhaines
Copy link
Author

Brilliant!!! Works in an even more fantastic manner than before.

@cowboyd
Copy link
Collaborator

cowboyd commented May 26, 2010

Glad to hear it. I always forget that it only searches SHAs inside the current project and not globally. I fixed the link above, but it sounds like you got it.

cheers,
Charles

@coreyhaines
Copy link
Author

Yeah, I rebuilt and installed cucumber from your fork, rather than aslak's

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants