Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2848 from arunagw/jruby_activesupport_fix

Need to have a check here for JAVA PLATFORM for JRuby
  • Loading branch information...
commit 74372f7e795dd0e1825dec19dd128b5ae6fb9dfc 2 parents ef7e60f + fc5e3ff
@jonleighton jonleighton authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 activesupport/test/core_ext/module_test.rb
View
10 activesupport/test/core_ext/module_test.rb
@@ -183,8 +183,9 @@ def test_delegation_exception_backtrace
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 @@ def test_delegation_exception_backtrace_with_allow_nil
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
Please sign in to comment.
Something went wrong with that request. Please try again.