Sha256: eadfdff86b30e30f773685d90a05bfd1ca51b3276bef52905e498d0928f7fecb

Contents?: true

Size: 724 Bytes

Versions: 3

Compression:

Stored size: 724 Bytes

Contents

# encoding: utf-8
require_relative "../spec_helper"

describe LogStash::Outputs::Mongodb, :integration => true do

  let(:uri)        { 'mongodb://localhost:27017' }
  let(:database)   { 'logstash' }
  let(:collection) { 'logs' }

  let(:config) do
    { "uri" => uri, "database" => database, "collection" => collection }
  end

  describe "#send" do

    subject { LogStash::Outputs::Mongodb.new(config) }

    let(:properties) { { "message" => "This is a message!"} }
    let(:event)      { LogStash::Event.new(properties) }

    before(:each) do
      subject.register
    end

    it "should send the event to the database" do
      subject.receive(event)
      expect(subject).to have_received(event)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
logstash-output-mongodb-2.0.2 spec/integration/mongodb_spec.rb
logstash-output-mongodb-2.0.1 spec/integration/mongodb_spec.rb
logstash-output-mongodb-1.0.0 spec/integration/mongodb_spec.rb