test/plugin/test_out_notifier.rb in fluent-plugin-notifier-0.2.3 vs test/plugin/test_out_notifier.rb in fluent-plugin-notifier-0.2.4
- old
+ new
@@ -1,8 +1,12 @@
require 'helper'
class NotifierOutputTest < Test::Unit::TestCase
+ def setup
+ Fluent::Test.setup
+ end
+
CONFIG = %[
type notifier
input_tag_remove_prefix test
<test>
check numeric
@@ -105,7 +109,17 @@
d = create_driver
d.run do
d.emit({'num1' => 60, 'message' => 'foo bar WARNING xxxxx', 'numfield' => '20'})
end
assert_equal 0, d.emits.size
+ end
+
+ def test_emit_invalid_byte
+ invalid_utf8 = "\xff".force_encoding('UTF-8')
+ d = create_driver
+ assert_nothing_raised {
+ d.run do
+ d.emit({'num1' => 60, 'message' => "foo bar WARNING #{invalid_utf8}", 'numfield' => '30', 'textfield' => 'TargetX'})
+ end
+ }
end
end