Sha256: b917098645a0dc78476768a4fdfe877d0bd9ffa8c7ce0236909253bd8a1503df

Contents?: true

Size: 384 Bytes

Versions: 3

Compression:

Stored size: 384 Bytes

Contents

# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/mongodb"

RSpec::Matchers.define :have_received do |event|
  match do |subject|
    client     = subject.instance_variable_get("@db")
    collection = subject.instance_variable_get("@collection")
    client["#{collection}"].find("@timestamp" => event["@timestamp"].to_json).count > 0
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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