diff options
author | Arun Agrawal <arun@fromjaipur.com> | 2011-09-04 13:18:57 +0530 |
---|---|---|
committer | Arun Agrawal <arun@fromjaipur.com> | 2011-09-04 15:33:58 +0530 |
commit | fc5e3ff1ba0d361b7091585094d0eca68b821108 (patch) | |
tree | 233272a101572a80c5f96475ecd1a1055319a5d4 /activesupport | |
parent | 0eefd8dc4884217e70ed99fb7d8ae272c7ce2d12 (diff) | |
download | rails-fc5e3ff1ba0d361b7091585094d0eca68b821108.tar.gz rails-fc5e3ff1ba0d361b7091585094d0eca68b821108.tar.bz2 rails-fc5e3ff1ba0d361b7091585094d0eca68b821108.zip |
We can't simply check the first line of the backtrace,
because JRuby reports the call to __send__ in the backtrace.
Diffstat (limited to 'activesupport')
-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 |