Sha256: a58a0103eed88b862d1b45e471adfcb92122ea34ae91b8c0177098fa69d856a8
Contents?: true
Size: 1.42 KB
Versions: 1
Compression:
Stored size: 1.42 KB
Contents
require 'test_helper' require 'time' class BufferedSlackOutputTest < Test::Unit::TestCase def setup super Fluent::Test.setup end CONFIG2 = %[ type buffered_slack rtm true token testtoken channel C01234567 username testuser color good icon_emoji :ghost: buffer_path ./test/tmp ] def create_driver(conf = CONFIG2) Fluent::Test::BufferedOutputTestDriver.new(Fluent::BufferedSlackOutput).configure(conf) end def test_format_rtm d = create_driver time = Time.parse("2014-01-01 22:00:00 UTC").to_i d.tag = 'test' stub(d.instance.slack).ping( nil, channel: 'C01234567', username: 'testuser', icon_emoji: ':ghost:', attachments: [{ color: 'good', text: "[#{Time.at(time).in_time_zone('Tokyo')}] sowawa\n" }] ) d.emit({message: 'sowawa'}, time) d.expect_format %[#{['test', time, {message: 'sowawa'}].to_msgpack}] d.run end def test_write_rtm d = create_driver time = Time.parse("2014-01-01 22:00:00 UTC").to_i d.tag = 'test' stub(d.instance.slack).ping( nil, channel: 'C01234567', username: 'testuser', icon_emoji: ':ghost:', attachments: [{ color: 'good', text: "[#{Time.at(time).in_time_zone('Tokyo')}] sowawa\n" }] ) d.emit({message: 'sowawa1'}, time) d.emit({message: 'sowawa2'}, time) d.run end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fluent-plugin-slack-0.4.0 | test/plugin/test_out_buffered_slack_rtm.rb |