Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

We can't simply check the first line of the backtrace,

because JRuby reports the call to __send__ in the backtrace.
  • Loading branch information...
commit fc5e3ff1ba0d361b7091585094d0eca68b821108 1 parent 0eefd8d
@arunagw 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.