Sha256: 7a5772400fe7aaf03eb7b25d3196002602cdd26ba8e634301bcd33b31b3590c5

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 Bytes

Contents

describe Fluent::ChatworkOutput do
  let(:driver)   { Fluent::Test::OutputTestDriver.new(Fluent::ChatworkOutput, 'test.metrics').configure(config) }
  let(:instance) { driver.instance }

  let(:config) do
    %[
      api_token xxxxxxxxxxxxxxxxxxxx
      room_id   1234567890
      message   some message
      ]
  end

  describe "config" do
    it "should get api_token" do
      expect( instance.api_token ).to eq "xxxxxxxxxxxxxxxxxxxx"
    end

    it "should get room_id" do
      expect( instance.room_id ).to eq "1234567890"
    end

    it "should get message" do
      expect( instance.message ).to eq "some message"
    end
  end

  describe "#emit" do
    let(:record){ {} }

    before do
      allow(instance).to receive(:post_message)
    end

    it "should be called" do
      driver.emit(record)
      expect(driver.run).not_to be_nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-plugin-out_chatwork-0.0.1 spec/lib/fluent/plugin/out_chatwork_spec.rb