-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Environment
jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 24.45-b08 on 1.7.0_45-b18 +jit [darwin-x86_64]
Darwin shinji.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
First discovered in the body of a large Rails 4.2.6 application where I am piloting the transition to JRuby 9K, but reproduced in a stock Rails application fresh out of the scaffold.
Other relevant info you may wish to add:
- Rails 4.2.7
Expected Behavior
- Defining a function in the body of a test should not cause a
ClassCastExceptionto be raised at runtime. It worked fine under JRuby 1.7.x.
require 'test_helper'
class FailcaseTest < ActiveSupport::TestCase
test 'should not throw a class cast exception' do
def bad
end
end
endActual Behavior
bundle exec rake test
Run options: --seed 7502
# Running:
E
Finished in 0.028675s, 34.8738 runs/s, 0.0000 assertions/s.
1) Error:
FailcaseTest#test_should_not_throw_a_class_cast_exception:
Java::JavaLang::ClassCastException: org.jruby.RubyObjectVar7 cannot be cast to org.jruby.RubyModule
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
Reactions are currently unavailable