-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Moved from http://jira.codehaus.org/browse/JRUBY-7128, reported by @nirvdrum.
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
endThis 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
endAnd 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels