Sha256: 66282fff1660082dfcadcd44f2c9f325d3f4a3383816191cb47c8afe4b701279

Contents?: true

Size: 770 Bytes

Versions: 37

Compression:

Stored size: 770 Bytes

Contents

require 'test_helper'
require 'flipper/adapters/mongo'

class MongoTest < MiniTest::Test
  prepend Flipper::Test::SharedAdapterTests

  def setup
    host = ENV.fetch('MONGODB_HOST', '127.0.0.1')
    port = '27017'
    logger = Logger.new('/dev/null')
    client = Mongo::Client.new(["#{host}:#{port}"],
                               server_selection_timeout: 0.01,
                               database: 'testing',
                               logger: logger)
    collection = client['testing']
    begin
      collection.drop
      collection.create
    rescue Mongo::Error::NoServerAvailable
      ENV['CI'] ? raise : skip('Mongo not available')
    rescue Mongo::Error::OperationFailure
    end
    @adapter = Flipper::Adapters::Mongo.new(collection)
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
flipper-mongo-1.3.2 test/adapters/mongo_test.rb
flipper-mongo-1.3.1 test/adapters/mongo_test.rb
flipper-mongo-1.3.0 test/adapters/mongo_test.rb
flipper-mongo-1.3.0.pre test/adapters/mongo_test.rb
flipper-mongo-1.2.2 test/adapters/mongo_test.rb
flipper-mongo-1.2.1 test/adapters/mongo_test.rb
flipper-mongo-1.2.0 test/adapters/mongo_test.rb
flipper-mongo-1.1.2 test/adapters/mongo_test.rb
flipper-mongo-1.1.1 test/adapters/mongo_test.rb
flipper-mongo-1.1.0 test/adapters/mongo_test.rb
flipper-mongo-1.0.0 test/adapters/mongo_test.rb
flipper-mongo-1.0.0.pre test/adapters/mongo_test.rb
flipper-mongo-0.28.3 test/adapters/mongo_test.rb
flipper-mongo-0.28.2 test/adapters/mongo_test.rb
flipper-mongo-0.28.1 test/adapters/mongo_test.rb
flipper-mongo-0.28.0 test/adapters/mongo_test.rb
flipper-mongo-0.27.1 test/adapters/mongo_test.rb
flipper-mongo-0.27.0 test/adapters/mongo_test.rb
flipper-mongo-0.26.2 test/adapters/mongo_test.rb
flipper-mongo-0.26.0 test/adapters/mongo_test.rb