Skip to content

Commit 54950e0

Browse files
committed
Suppressed "<internal:array>:52:in 'Array#each'" from backtrace
1 parent 675498c commit 54950e0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/rake/backtrace.rb

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Backtrace # :nodoc: all
1010
map { |f| File.expand_path(f) }.
1111
reject { |s| s.nil? || s =~ /^ *$/ }
1212
SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|")
13+
SUPPRESSED_PATHS_RE << "|^<internal:\\w+>"
1314
SUPPRESSED_PATHS_RE << "|^org\\/jruby\\/\\w+\\.java" if
1415
Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == "jruby"
1516

test/test_rake_backtrace.rb

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ def test_near_system_dir_isnt_suppressed
3232

3333
assert_equal paths, actual
3434
end
35+
36+
def test_ruby_array_each_suppressed
37+
paths = ["<internal:array>:52:in 'Array#each'"]
38+
39+
actual = Rake::Backtrace.collapse(paths)
40+
41+
assert_equal [], actual
42+
end
3543
end
3644

3745
class TestRakeBacktrace < Rake::TestCase # :nodoc:

0 commit comments

Comments
 (0)