lib/petitest/texts/error_message_text.rb in petitest-0.2.0 vs lib/petitest/texts/error_message_text.rb in petitest-0.2.1
- old
+ new
@@ -11,10 +11,14 @@
@test_case = test_case
end
# @note Override
def to_s
- colorize("#{test_case.error_class_name}: #{test_case.error_message}", :error)
+ elements = []
+ elements << test_case.error_class_name unless test_case.error.is_a?(::Petitest::AssertionFailureError)
+ elements << test_case.error_message unless test_case.error_message.empty?
+ string = elements.join("\n")
+ colorize(string, :error)
end
end
end
end