Sha256: 0ca60d780909f71dbb6115cf1250b1cb73eb89c633ab5f18be8df49e03e951ee

Contents?: true

Size: 1.26 KB

Versions: 3

Compression:

Stored size: 1.26 KB

Contents

require 'simplecov'
require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]
SimpleCov.start do
  add_filter '/spec/'
  add_filter '/vendor/'
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'fileutils'
require 'tmpdir'
require 'vvm-rb'
include VvmRb

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

# [todo] - test is too slow

RSpec.configure do |config|
  config.before :suite do
    cache_dir = get_cache_dir
    unless File.exists?(cache_dir)
      ENV['VVMROOT'] = cache_dir
      FileUtils.mkdir_p(cache_dir)
      Installer.fetch
      %w{ v7-4-083 v7-4-103 }.each do |v|
        i = Installer.new(v, [], true)
        i.checkout
        i.configure
        i.make_install
      end
      Installer.cp_etc
    end
  end

  config.before :all do
    @tmp = Dir.mktmpdir
    FileUtils.cp_r(get_cache_dir, @tmp)
    ENV['VVMROOT'] = File.expand_path(File.join(@tmp, '.vvm_cache'))
    ENV['VVMOPT'] = nil
  end

  config.after :all do
    FileUtils.rm_rf(@tmp)
  end
end

def get_cache_dir
  File.expand_path(File.join(File.dirname(__FILE__), '..', '.vvm_cache'))
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vvm-rb-0.1.4 spec/spec_helper.rb
vvm-rb-0.1.3 spec/spec_helper.rb
vvm-rb-0.1.2 spec/spec_helper.rb