spec/lib/fluent/plugin/chatwork_spec.rb in fluent-plugin-chatwork-2.0.1 vs spec/lib/fluent/plugin/chatwork_spec.rb in fluent-plugin-chatwork-2.0.2

- old
+ new

@@ -32,9 +32,28 @@ it "should get buffered" do expect( instance.buffered ).to be_falsy end end + describe "lack of tag in chunk_keys" do + let(:config) do + Fluent::Config::Element.new( + 'ROOT', '', { + '@type' => 'charwork', + 'api_token' => 'xxxxxxxxxxxxxxxxxxxx', + 'room_id' => 1234567890, + 'message' => 'some message', + }, [ + Fluent::Config::Element.new('buffer', 'mykey', { + 'chunk_keys' => 'mykey' + }, []) + ]) + end + it "raises Fluent::ConfigError" do + expect { driver }.to raise_error(/'tag' in chunk_keys is required./) + end + end + describe "#emit" do let(:record){ {} } before do allow(instance).to receive(:post_message)