Skip to content

Commit

Permalink
Don't assume that backtraces are Array subclasses when tweaking them
Browse files Browse the repository at this point in the history
  • Loading branch information
wilson authored and dchelimsky committed Dec 19, 2008
1 parent 699cd19 commit 6cb6a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/spec/runner/backtrace_tweaker.rb
Expand Up @@ -40,7 +40,7 @@ class QuietBacktraceTweaker < BacktraceTweaker

def tweak_backtrace(error)
return if error.backtrace.nil?
error.backtrace.collect! do |message|
tweaked = error.backtrace.collect do |message|
clean_up_double_slashes(message)
kept_lines = message.split("\n").select do |line|
IGNORE_PATTERNS.each do |ignore|
Expand All @@ -49,7 +49,7 @@ def tweak_backtrace(error)
end
kept_lines.empty?? nil : kept_lines.join("\n")
end
error.backtrace.compact!
error.set_backtrace(tweaked.select {|line| line})
end
end
end
Expand Down

0 comments on commit 6cb6a63

Please sign in to comment.