Class: CodeClimate::TestReporter::ExceptionMessage
- Inherits:
-
Object
- Object
- CodeClimate::TestReporter::ExceptionMessage
- Defined in:
- lib/code_climate/test_reporter/exception_message.rb
Constant Summary collapse
- HTTP_STUBBING_MESSAGES =
{ "VCR::Errors::UnhandledHTTPRequestError".freeze => VCRMessage, "WebMock::NetConnectNotAllowedError".freeze => WebMockMessage, }.freeze
Instance Method Summary collapse
-
#initialize(exception) ⇒ ExceptionMessage
constructor
A new instance of ExceptionMessage.
- #message ⇒ Object
Constructor Details
#initialize(exception) ⇒ ExceptionMessage
Returns a new instance of ExceptionMessage.
36 37 38 |
# File 'lib/code_climate/test_reporter/exception_message.rb', line 36 def initialize(exception) @exception = exception end |
Instance Method Details
#message ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/code_climate/test_reporter/exception_message.rb', line 40 def parts = [] parts << "Code Climate encountered an exception: #{exception_class}" if http_stubbing_exception = http_stubbing_exception.new parts << "======" parts << "Hey! Looks like you are using #{.library_name}, which will prevent the codeclimate-test-reporter from reporting results to codeclimate.com. Add the following to your spec or test helper to ensure codeclimate-test-reporter can post coverage results:" parts << "\n" + .instructions + "\n" parts << "======" parts << "If this doesn't work, please consult https://codeclimate.com/docs#test-coverage-troubleshooting" parts << "======" else parts << @exception. @exception.backtrace.each do |line| parts << line end end parts.join("\n") end |