summary refs log tree commit homepage
path: root/t/test_isolate_cramp.rb
blob: c0801277273c21450008aafaa892347b225143a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'rubygems'
require 'isolate'
engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'

path = "tmp/isolate/#{engine}-#{RUBY_VERSION}/cramp"
opts = {
  :system => false,
  # we want "ruby-1.8.7" and not "ruby-1.8", so disable multiruby
  :multiruby => false,
  :path => path,
}

old_out = $stdout.dup
$stdout.reopen($stderr)

lock = File.open(__FILE__, "rb")
lock.flock(File::LOCK_EX)
Isolate.now!(opts) do
  if engine == "ruby"
    gem 'cramp', '0.15'
  end
end

$stdout.reopen(old_out)
dirs = Dir["#{path}/gems/*-*/lib"]
puts dirs.map { |x| File.expand_path(x) }.join(':')