Sha256: 98f5f83dac6388e786a1a529a5d8f89c650c1ce6eed79f9eac4fc1d9bec8a921

Contents?: true

Size: 1.2 KB

Versions: 9

Compression:

Stored size: 1.2 KB

Contents

if RUBY_VERSION >= '1.9.3'
  gemfile <<-RB
    gem 'mongo', '~>2.2.0'
  RB
  gemfile <<-RB
    gem 'mongo', '~>2.1.0'
  RB
  gemfile <<-RB
    gem 'mongo', '~>2.0.1'
  RB
end

gemfile <<-RB
  gem 'mongo', '1.10.0'
  gem 'bson_ext', :platforms => :ruby
RB

gemfile <<-RB
  gem 'mongo', '1.9.2'
  gem 'bson_ext', :platforms => :ruby
RB

gemfile <<-RB
  gem 'mongo', '~>1.8.6'
  gem 'bson_ext', :platforms => :ruby
RB

# Versions <= 1.7.1 are not supported and never will be.
gemfile <<-RB
  gem 'mongo', '~>1.7.1'
  gem 'bson_ext', :platforms => :ruby
RB

require 'timeout'
require 'socket'

class PreExistingMongo
  attr_reader :host, :port

  def initialize(host, port)
    @host = host
    @port = port
  end

  def stop(*_)
  end
end

$mongo = PreExistingMongo.new("127.0.0.1", 27017)

def mongo_running?
  Timeout::timeout(1) do
    begin
      TCPSocket.new($mongo.host, $mongo.port).close
      true
    rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
      false
    end
  end
rescue Timeout::Error
  false
end

before_suite do
  if !mongo_running?
    require File.join(File.dirname(__FILE__), 'helpers', 'mongo_server')
    $mongo = MongoServer.new
    $mongo.start(false)
  end
end

after_suite do
  $mongo.stop
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
newrelic_rpm-3.17.2.327 test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.17.1.326 test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.17.0.325 test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.16.3.323 test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.16.2.321 test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.16.1.320 test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.16.0.318 test/multiverse/suites/mongo/Envfile
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/multiverse/suites/mongo/Envfile
newrelic_rpm-3.15.2.317 test/multiverse/suites/mongo/Envfile