collectiveidea / json_spec

Easily handle JSON in RSpec and Cucumber
rubygems.org/gems/json_spec
MIT License
919 stars 114 forks source link

"the JSON should be ..." failing in JRuby #18

Closed declan closed 12 years ago

declan commented 12 years ago

I'm using JRuby 1.6.5 with Rails 3.1.3 and Cucumber 1.1.4.

When I try to use the step 'the JSON should be ...' I get this error

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.length (NoMethodError)
/home/declan/.rvm/gems/jruby-1.6.5@neo/gems/cucumber-1.1.4/bin/../lib/cucumber/step_match.rb:73:in `replace_arguments'
...

Current workaround is to use 'the JSON at "" should be ...' instead, i.e. use the JSON at PATH step, and just give it the root path.

laserlemon commented 12 years ago

I haven't been able to get json_spec consistently passing in JRuby. I've removed support for JRuby in the Travis build until somebody comes forward to help keep it JRuby-compatible. Let me know if you're interested.

declan commented 12 years ago

In principle, sure. I've found this gem tremendously helpful on the JRuby project I'm currently working on. Let me take a look at the code later this week and see if it's something I think I could manage.

heisee commented 12 years ago

this might relate to https://github.com/cucumber/cucumber/issues/188