test/test_logger.rb in gelf-1.1.0.beta3 vs test/test_logger.rb in gelf-1.1.0.beta4
- old
+ new
@@ -16,82 +16,82 @@
context "#add" do
# logger.add(Logger::INFO, 'Message')
should "implement add method with level and message from parameters" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'Message'
+ hash['gelf_short_message'] == 'Message'
end
@notifier.add(GELF::INFO, 'Message')
end
# logger.add(Logger::INFO, RuntimeError.new('Boom!'))
should "implement add method with level and exception from parameters" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'RuntimeError: Boom!' &&
- hash['full_message'] =~ /^Backtrace/
+ hash['gelf_short_message'] == 'RuntimeError: Boom!' &&
+ hash['gelf_full_message'] =~ /^Backtrace/
end
@notifier.add(GELF::INFO, RuntimeError.new('Boom!'))
end
# logger.add(Logger::INFO) { 'Message' }
should "implement add method with level from parameter and message from block" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'Message'
+ hash['gelf_short_message'] == 'Message'
end
@notifier.add(GELF::INFO) { 'Message' }
end
# logger.add(Logger::INFO) { RuntimeError.new('Boom!') }
should "implement add method with level from parameter and exception from block" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'RuntimeError: Boom!' &&
- hash['full_message'] =~ /^Backtrace/
+ hash['gelf_short_message'] == 'RuntimeError: Boom!' &&
+ hash['gelf_full_message'] =~ /^Backtrace/
end
@notifier.add(GELF::INFO) { RuntimeError.new('Boom!') }
end
# logger.add(Logger::INFO, 'Message', 'Facility')
should "implement add method with level, message and facility from parameters" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'Message' &&
- hash['facility'] == 'Facility'
+ hash['gelf_short_message'] == 'Message' &&
+ hash['gelf_facility'] == 'Facility'
end
@notifier.add(GELF::INFO, 'Message', 'Facility')
end
# logger.add(Logger::INFO, RuntimeError.new('Boom!'), 'Facility')
should "implement add method with level, exception and facility from parameters" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'RuntimeError: Boom!' &&
- hash['full_message'] =~ /^Backtrace/ &&
- hash['facility'] == 'Facility'
+ hash['gelf_short_message'] == 'RuntimeError: Boom!' &&
+ hash['gelf_full_message'] =~ /^Backtrace/ &&
+ hash['gelf_facility'] == 'Facility'
end
@notifier.add(GELF::INFO, RuntimeError.new('Boom!'), 'Facility')
end
# logger.add(Logger::INFO, 'Facility') { 'Message' }
should "implement add method with level and facility from parameters and message from block" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'Message' &&
- hash['facility'] == 'Facility'
+ hash['gelf_short_message'] == 'Message' &&
+ hash['gelf_facility'] == 'Facility'
end
@notifier.add(GELF::INFO, 'Facility') { 'Message' }
end
# logger.add(Logger::INFO, 'Facility') { RuntimeError.new('Boom!') }
should "implement add method with level and facility from parameters and exception from block" do
@notifier.expects(:notify_with_level!).with do |level, hash|
level == GELF::INFO &&
- hash['short_message'] == 'RuntimeError: Boom!' &&
- hash['full_message'] =~ /^Backtrace/ &&
- hash['facility'] == 'Facility'
+ hash['gelf_short_message'] == 'RuntimeError: Boom!' &&
+ hash['gelf_full_message'] =~ /^Backtrace/ &&
+ hash['gelf_facility'] == 'Facility'
end
@notifier.add(GELF::INFO, 'Facility') { RuntimeError.new('Boom!') }
end
end
@@ -124,11 +124,11 @@
end
end
should "support Notifier#<<" do
@notifier.expects(:notify_with_level!).with do |nil_, hash|
- hash['short_message'] == "Message" &&
- hash['level'] == GELF::UNKNOWN
+ hash['gelf_short_message'] == "Message" &&
+ hash['gelf_level'] == GELF::UNKNOWN
end
@notifier << "Message"
end
end
end