jimweirich / rspec-given

Given/When/Then keywords for RSpec Specifications
https://github.com/jimweirich/rspec-given
MIT License
653 stars 61 forks source link

Error when using Rspec Given w/ jruby (Ripper is not supported in jruby) #11

Closed st23am closed 11 years ago

st23am commented 11 years ago

Using jruby 1.7.2 with rails 3.2.11 and rspec-given version 2.3.0

Running specs gives an error message: Ripper is not supported in jruby

jimweirich commented 11 years ago

Rats. Is there a Ripper replacement in JRuby?

jimweirich commented 11 years ago

I'll disable Sorcerer, Ripper (and hence Natural Assertions) when using JRuby for now. If we can dig up a Ripper replacement, I'll consider adding it back in.

st23am commented 11 years ago

That sounds great. Thanks Jim! I'll be on the look out for something that could for now replace Ripper/Sorcerer. From this blog post http://www.jruby.org/2012/10/22/jruby-1-7-0.html it looks as though the jruby team is aware of the issue.

PikachuEXE commented 11 years ago

After updating to 2.3.1, it seems that the gem is still trying to load Sorcerer And that cause LoadError when trying to run any spec even I specified RSpec::Given.use_natural_assertions false in spec_helper.rb

StackTrace:

from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/rspec-given-2.3.1/lib/rspec/given/natural_assertion.rb:6:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/rspec-given-2.3.1/lib/rspec/given/extensions.rb:3:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/rspec-given-2.3.1/lib/rspec/given/core.rb:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/rspec-given-2.3.1/lib/rspec/given.rb:15:in `<top (required)>'
jimweirich commented 11 years ago

PikachuEXE ... What version of JRuby are you running? (What's the value of JRUBY_VERSION?)

PikachuEXE commented 11 years ago

I am using MRI 1.9.3 p374, not JRuby

jimweirich commented 11 years ago

Hmm, I removed Sorcerer as a gem dependency for JRuby, but it is still getting loaded for non-JRuby platform. Either gem install sorcerer or add to your Gemfile as appropriate. I'll either add it back as a gem dependency or give a better error message in the next version.

Thanks for catching this.

PikachuEXE commented 11 years ago

gem install won't fix it It has to be added into Gemfile Maybe add an entry in Readme

jimweirich commented 11 years ago

I added the sorcerer dependency back into the gemspec. It installs with JRuby, so that's ok. But actually loading it is disabled in JRuby. That should make everyone happy.

This change is is in rspec-given-2.3.2.

PikachuEXE commented 11 years ago

OK I am gonna try it :)

PikachuEXE commented 11 years ago

2.3.2 does fix the problem. Thanks!

But I did not see 2.3.2 in repo @@?