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-0.26.0.rc2 test/adapters/mongo_test.rb
flipper-mongo-0.26.0.rc1 test/adapters/mongo_test.rb
flipper-mongo-0.25.4 test/adapters/mongo_test.rb
flipper-mongo-0.25.3 test/adapters/mongo_test.rb
flipper-mongo-0.25.2 test/adapters/mongo_test.rb
flipper-mongo-0.25.1 test/adapters/mongo_test.rb
flipper-mongo-0.25.0 test/adapters/mongo_test.rb
flipper-mongo-0.24.1 test/adapters/mongo_test.rb
flipper-mongo-0.24.0 test/adapters/mongo_test.rb
flipper-mongo-0.23.1 test/adapters/mongo_test.rb
flipper-mongo-0.23.0 test/adapters/mongo_test.rb
flipper-mongo-0.22.2 test/adapters/mongo_test.rb
flipper-mongo-0.22.1 test/adapters/mongo_test.rb
flipper-mongo-0.22.0 test/adapters/mongo_test.rb
flipper-mongo-0.21.0 test/adapters/mongo_test.rb
flipper-mongo-0.21.0.rc2 test/adapters/mongo_test.rb
flipper-mongo-0.21.0.rc1 test/adapters/mongo_test.rb