Browse files

call #to_s on exception_message before calling #split

When 1.8.7 is shutting down its threads, and you're stuck in a Monitor,
it will eventually raise a SystemExit, and that SystemExit may have an
instance of Exception as its `#message` (instead of a String) which
causes the formatter to blow up.
  • Loading branch information...
1 parent c9b8681 commit 2d39c466664429bfa0f56f6cd4b1b419df8077bf @slyphon slyphon committed May 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rspec/core/formatters/base_text_formatter.rb
2 lib/rspec/core/formatters/base_text_formatter.rb
@@ -179,7 +179,7 @@ def dump_failure_info(example)
exception = example.execution_result[:exception]
output.puts "#{long_padding}#{red("Failure/Error:")} #{red(read_failed_line(exception, example).strip)}"
output.puts "#{long_padding}#{red( << ":")}" unless =~ /RSpec/
- exception.message.split("\n").each { |line| output.puts "#{long_padding} #{red(line)}" } if exception.message
+ exception.message.to_s.split("\n").each { |line| output.puts "#{long_padding} #{red(line)}" } if exception.message
if shared_group = find_shared_group(example)

0 comments on commit 2d39c46

Please sign in to comment.