Sha256: 5915fb20320d6d04df8b1e59ea59ac902e1fce59d9b46a3afd479558056c49b4
Contents?: true
Size: 1.73 KB
Versions: 3
Compression:
Stored size: 1.73 KB
Contents
require 'helper' class MailOutputTest < Test::Unit::TestCase CONFIG_OUT_KEYS = %[ out_keys tag,time,value time_key time time_format %Y/%m/%d %H:%M:%S tag_key tag subject Fluentd Notification Alarm %s subject_out_keys tag host localhost port 25 from localhost@localdomain to localhost@localdomain ] CONFIG_CC_BCC = %[ out_keys tag,time,value time_key time time_format %Y/%m/%d %H:%M:%S tag_key tag subject Fluentd Notification Alarm %s subject_out_keys tag host localhost port 25 from localhost@localdomain cc localhost@localdomain bcc localhost@localdomain ] CONFIG_MESSAGE = %[ message out_mail: %s [%s]\\n%s message_out_keys tag,time,value time_key time time_format %Y/%m/%d %H:%M:%S tag_key tag subject Fluentd Notification Alarm %s subject_out_keys tag host localhost port 25 from localhost@localdomain to localhost@localdomain ] def create_driver(conf=CONFIG_OUT_KEYS,tag='test') Fluent::Test::OutputTestDriver.new(Fluent::MailOutput, tag).configure(conf) end def test_configure d = create_driver(CONFIG_OUT_KEYS) assert_equal 'localhost', d.instance.host d = create_driver(CONFIG_CC_BCC) assert_equal 'localhost', d.instance.host d = create_driver(CONFIG_MESSAGE) assert_equal 'localhost', d.instance.host end def test_out_keys d = create_driver(CONFIG_OUT_KEYS) time = Time.now.to_i d.run do d.emit({'value' => "out_keys mail from fluentd out_mail"}, time) end end def test_message d = create_driver(CONFIG_MESSAGE) time = Time.now.to_i d.run do d.emit({'value' => "message mail from fluentd out_mail"}, time) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fluent-plugin-mail-0.0.5 | test/plugin/test_out_mail.rb |
fluent-plugin-mail-0.0.4 | test/plugin/test_out_mail.rb |
fluent-plugin-mail-0.0.3 | test/plugin/test_out_mail.rb |