Sha256: 6cbe880be350bed680ef37927e896f521155d3c9f298971aaab3a5ff5510e6be
Contents?: true
Size: 785 Bytes
Versions: 12
Compression:
Stored size: 785 Bytes
Contents
class SinatraErrorTracingTestApp < Sinatra::Base configure do set :show_exceptions, false end get '/will_boom' do raise 'Boom!' end error do 'We are sorry' end end class SinatraErrorTracingTest < Test::Unit::TestCase include Rack::Test::Methods include ::NewRelic::Agent::Instrumentation::Sinatra def app SinatraErrorTracingTestApp end def setup ::NewRelic::Agent.manual_start @error_collector = ::NewRelic::Agent.instance.error_collector assert(@error_collector.enabled?, 'error collector should be enabled') end def test_traps_errors get '/will_boom' assert_equal 500, last_response.status assert_equal 'We are sorry', last_response.body assert_equal(1, @error_collector.errors.size) end end
Version data entries
12 entries across 12 versions & 3 rubygems