spec/flipper/adapters/mongo_spec.rb in flipper-mongo-0.26.2 vs spec/flipper/adapters/mongo_spec.rb in flipper-mongo-0.27.0
- old
+ new
@@ -13,14 +13,14 @@
Mongo::Client.new(["#{host}:#{port}"], server_selection_timeout: 0.01, database: 'testing', logger: logger)
end
let(:collection) { client['testing'] }
before do
- begin
- collection.drop
- rescue Mongo::Error::NoServerAvailable
- ENV['CI'] ? raise : skip('Mongo not available')
- rescue Mongo::Error::OperationFailure
+ skip_on_error(Mongo::Error::NoServerAvailable, 'Mongo not available') do
+ begin
+ collection.drop
+ rescue Mongo::Error::OperationFailure
+ end
end
collection.create
end
it_should_behave_like 'a flipper adapter'