Move error message output to another method

This commit is contained in:
Michael Miller 2018-12-12 15:33:54 -07:00
parent 38ec35dd29
commit 9527427b45
1 changed files with 9 additions and 4 deletions

View File

@ -83,10 +83,15 @@ module Spectator
# But if an exception occurs outside an example,
# it's likely the fault of the test framework (Spectator).
# So we display a helpful error that could be reported and return non-zero.
puts
puts "Encountered an unexpected error in framework"
puts ex.message
puts ex.backtrace.join("\n")
display_error(ex)
exit(1)
end
# Displays an error message.
private def self.display_error(error)
puts
puts "Encountered an unexpected error in framework"
puts error.message
puts error.backtrace.join("\n")
end
end