Sha256: 73bcefba4b5f5fa5a9f42366475268b8ff21e16084da9e1aa277c9e17843805c
Contents?: true
Size: 1012 Bytes
Versions: 12
Compression:
Stored size: 1012 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__),'..','test_helper')) class NewRelic::Agent::NoticedErrorTest < Test::Unit::TestCase def setup @path = 'foo/bar/baz' @params = { 'key' => 'val' } @time = Time.now end def test_to_collector_array e = Exception.new('test exception') error = NewRelic::NoticedError.new(@path, @params, e, @time) expected = [ (@time.to_f * 1000).round, @path, 'test exception', 'Exception', @params ] assert_equal expected, error.to_collector_array end def test_to_collector_array_with_bad_values error = NewRelic::NoticedError.new(@path, @params, nil, Rational(10, 1)) expected = [ 10_000.0, @path, "<no message>", "Error", @params ] assert_equal expected, error.to_collector_array end def test_handles_non_string_exception_messages e = Exception.new({ :non => :string }) error = NewRelic::NoticedError.new(@path, @params, e, @time) assert_equal(String, error.message.class) end end
Version data entries
12 entries across 12 versions & 3 rubygems