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