Permalink
Browse files

On some rubies (e.g. 1.8) anonymous classes are named '', not nil.

  • Loading branch information...
1 parent 356f15a commit c4f1b201b4a16765046f7b7750f8999f63f01ca8 @myronmarston myronmarston committed Dec 22, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/rspec/core/formatters/base_text_formatter.rb
@@ -210,7 +210,9 @@ def dump_failure_info(example)
end
def exception_class_name_for(exception)
- exception.class.name || "(anonymous error class)"
+ name = exception.class.name.to_s
+ name ="(anonymous error class)" if name == ''
+ name
end
def dump_shared_failure_info(group)

0 comments on commit c4f1b20

Please sign in to comment.