Skip to content
Browse files

We can't simply check the first line of the

backtrace, because JRuby reports the call 
to __send__ in the backtrace.

In JRuby first is "org/jruby/RubyKernel.java"
  • Loading branch information...
1 parent 04c25a7 commit 5df885e59d43bb3e5d45727f88256c7c26259d2a @arunagw committed Sep 4, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 activesupport/test/core_ext/module_test.rb
View
5 activesupport/test/core_ext/module_test.rb
@@ -172,8 +172,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_parent

0 comments on commit 5df885e

Please sign in to comment.
Something went wrong with that request. Please try again.