Issue Type: Bug Bug
Assignee: Thomas E Enebo
Created: 21/Mar/13 8:53 AM
Description:

This might be a bug in rspec-expectations, but I'm unable to force JIT my app due to a bad :remove_method call. Specifically, in my rspec (2.13.0) setup, I've tried to disable the old should syntax with something like the following:

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

This causes rspec to execute this method:

def self.disable_deprecated_should
  return unless deprecated_should_enabled?

  remove_method :should
  remove_method :should_not

  self.deprecated_should_enabled = false
end

And when that's executed things blow up like so:

 ~/d/w/mogotest /master> rspec spec/models/user_spec.rb 
NameError: method 'should' not defined in RSpec::Expectations::ExpectationTarget
              remove_method at org/jruby/RubyModule.java:2331
  disable_deprecated_should at /home/nirvdrum/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rspec-expectations-2.13.0/lib/rspec/expectations/expectation_target.rb:71
             disable_should at /home/nirvdrum/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rspec-expectations-2.13.0/lib/rspec/expectations/syntax.rb:74
                    syntax= at /home/nirvdrum/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rspec-expectations-2.13.0/lib/rspec/matchers/configuration.rb:29

I'm raising the issue because I don't see this behavior when I don't force JIT. I don't know if it has to do with loading semantics or if force JIT should be resilient to errors like this. It could also just be an rspec bug that I can take up with them.

Project: JRuby
Priority: Major Major
Reporter: Kevin Menard
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to