Sha256: d373fba0536936714f683e936bfdf17b545a2e285cf71d239ab1c1afec021703

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

require 'helper'
require 'flipper/adapters/mongo'
require 'flipper/spec/shared_adapter_specs'

Mongo::Logger.logger.level = Logger::INFO

RSpec.describe Flipper::Adapters::Mongo do
  subject { described_class.new(collection) }

  let(:host) { ENV['BOXEN_MONGODB_HOST'] || '127.0.0.1' }
  let(:port) { ENV['BOXEN_MONGODB_PORT'] || 27017 }

  let(:client) do
    Mongo::Client.new(["#{host}:#{port}"], server_selection_timeout: 1, database: 'testing')
  end
  let(:collection) { client['testing'] }

  before do
    begin
      collection.drop
    rescue Mongo::Error::OperationFailure
    end
    collection.create
  end

  it_should_behave_like 'a flipper adapter'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flipper-mongo-0.11.0.beta3 spec/flipper/adapters/mongo_spec.rb
flipper-mongo-0.11.0.beta1 spec/flipper/adapters/mongo_spec.rb