diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-09-04 03:11:45 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-09-04 03:11:45 -0700 |
commit | 74372f7e795dd0e1825dec19dd128b5ae6fb9dfc (patch) | |
tree | 9e059755029f727f6b8866154f3f008840f40ae8 /activesupport/test/core_ext/module_test.rb | |
parent | ef7e60f008aab5b6390f44ae8f5923edcdf470b8 (diff) | |
parent | fc5e3ff1ba0d361b7091585094d0eca68b821108 (diff) | |
download | rails-74372f7e795dd0e1825dec19dd128b5ae6fb9dfc.tar.gz rails-74372f7e795dd0e1825dec19dd128b5ae6fb9dfc.tar.bz2 rails-74372f7e795dd0e1825dec19dd128b5ae6fb9dfc.zip |
Merge pull request #2848 from arunagw/jruby_activesupport_fix
Need to have a check here for JAVA PLATFORM for JRuby
Diffstat (limited to 'activesupport/test/core_ext/module_test.rb')
-rw-r--r-- | activesupport/test/core_ext/module_test.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb index 449d3810e2..f11bf3dc69 100644 --- a/activesupport/test/core_ext/module_test.rb +++ b/activesupport/test/core_ext/module_test.rb @@ -183,8 +183,9 @@ class ModuleTest < Test::Unit::TestCase someone.foo rescue NoMethodError => e file_and_line = "#{__FILE__}:#{Someone::FAILED_DELEGATE_LINE}" - assert e.backtrace.first.include?(file_and_line), - "[#{e.backtrace.first}] did not include [#{file_and_line}]" + # We can't simply check the first line of the backtrace, because JRuby reports the call to __send__ in the backtrace. + assert e.backtrace.any?{|a| a.include?(file_and_line)}, + "[#{e.backtrace.inspect}] did not include [#{file_and_line}]" end def test_delegation_exception_backtrace_with_allow_nil @@ -192,8 +193,9 @@ class ModuleTest < Test::Unit::TestCase someone.bar rescue NoMethodError => e file_and_line = "#{__FILE__}:#{Someone::FAILED_DELEGATE_LINE_2}" - assert e.backtrace.first.include?(file_and_line), - "[#{e.backtrace.first}] did not include [#{file_and_line}]" + # We can't simply check the first line of the backtrace, because JRuby reports the call to __send__ in the backtrace. + assert e.backtrace.any?{|a| a.include?(file_and_line)}, + "[#{e.backtrace.inspect}] did not include [#{file_and_line}]" end def test_parent |