Sha256: 454fc0ba4592edaf369b6196e1fccd94eb42b5a38539b6dd5bac0d496d223be1

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

require 'pp'
require 'rubygems'
require 'bundler'

if ENV['COVERAGE']
  require 'simplecov'
  SimpleCov.start
end

module RR
  module Test
    def self.setup_test_suite(adapter_name)
      puts "Setting up test suite for #{adapter_name}" if ENV['RR_DEBUG']
      unset_bundler_vars
      adapter = Adapter.new(adapter_name)
      ENV['ADAPTER'] = adapter.name.to_s
      puts "Using appraisal: #{adapter.appraisal.name}" if ENV['RR_DEBUG']
      ENV['BUNDLE_GEMFILE'] = adapter.appraisal.gemfile_path
      puts "Using gemfile: #{adapter.appraisal.gemfile_path}" if ENV['RR_DEBUG']
      Bundler.setup(:default)
      $:.unshift File.expand_path('../../lib', __FILE__)
    end

    def self.unset_bundler_vars
      # Copied from appraisal
      %w(RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE).each do |name|
        ENV[name] = nil
      end
    end
  end
end

lib_path = File.expand_path("../../lib", __FILE__)
$LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)

Dir[ File.expand_path('../support/**/*.rb', __FILE__) ].each { |fn| require fn }

$stdout.sync = true

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rr-3.1.1 spec/global_helper.rb
rr-3.1.0 spec/global_helper.rb
rr-3.0.9 spec/global_helper.rb
rr-3.0.8 spec/global_helper.rb
rr-3.0.7 spec/global_helper.rb
rr-3.0.6 spec/global_helper.rb
rr-3.0.5 spec/global_helper.rb
rr-3.0.4 spec/global_helper.rb
rr-3.0.3 spec/global_helper.rb
rr-3.0.2 spec/global_helper.rb
rr-3.0.1 spec/global_helper.rb
rr-3.0.0 spec/global_helper.rb
rr-1.2.1 spec/global_helper.rb
rr-1.2.0 spec/global_helper.rb