class Honeybadger::CLI::Test

def verify_test

def verify_test
  Honeybadger.flush
  if calling = TestBackend.callings[:notices].find {|c| c[0].exception.eql?(TEST_EXCEPTION) }
    notice, response = *calling
    if !response.success?
      host = Honeybadger.config.get(:'connection.host')
      say(<<-MSG, :red)
 Honeybadger test failed ------------------------------------------------ !!
ror notifier is installed, but we encountered an error:
sponse.error_message}
 this issue, please try the following:
ke sure the gem is configured properly.
try executing this command a few times.
ke sure you can connect to #{host} (`curl https://#{host}/v1/notices`).
ail support@honeybadger.io for help. Include as much debug info as you
n for a faster resolution!
 End -------------------------------------------------------------------- !!
      exit(1)
    end
    say(generate_success_message(response), :green)
    exit(0)
  end
  say(<<-MSG, :red)
 Honeybadger test failed ------------------------------------------------ !!
 The test exception was not reported; the application may not be
ured properly.
s usually caused by one of the following issues:
ere was a problem loading your application. Check your logs to see if a
fferent exception is being raised.
e exception is being rescued before it reaches our Rack middleware. If
u're using `rescue` or `rescue_from` you may need to notify Honeybadger
nually: `Honeybadger.notify(exception)`.
e honeybadger gem is misconfigured. Check the settings in your
neybadger.yml file.
  notices = TestBackend.callings[:notices].map(&:first)
  unless notices.empty?
    say("\nThe following errors were reported:", :red)
    notices.each {|n| say("\n  - #{n.error_class}: #{n.error_message}", :red) }
  end
  say("\nSee https://docs.honeybadger.io/gem-troubleshooting for more troubleshooting help.\n\n", :red)
  say("!! --- End -------------------------------------------------------------------- !!", :red)
  exit(1)
end