Zbatery 3.3.0 - another Rainbows! resync
[zbatery.git] / t / test_isolate.rb
blob516752d5a2fa8a9481ac4736bb479da8f676a552
1 require 'rubygems'
2 require 'isolate'
3 engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
5 path = "tmp/isolate/#{engine}-#{RUBY_VERSION}"
6 opts = {
7   :system => false,
8   # we want "ruby-1.8.7" and not "ruby-1.8", so disable multiruby
9   :multiruby => false,
10   :path => path,
13 old_out = $stdout.dup
14 $stdout.reopen($stderr)
16 Isolate.now!(opts) do
17   gem 'rainbows', '3.3.0'
18   gem 'raindrops', '0.6.1'
20   if engine == "ruby"
21     gem 'sendfile', '1.1.0' # next Rubinius should support this
22     gem 'cool.io', '1.0.0'
24     gem 'eventmachine', '0.12.10'
25     gem 'sinatra', '1.2.0'
26     gem 'async_sinatra', '0.5.0'
28     gem 'neverblock', '0.1.6.2'
29   end
31   if defined?(::Fiber) && engine == "ruby"
32     gem 'revactor', '0.1.5'
33     gem 'rack-fiber_pool', '0.9.0'
34   end
36   if RUBY_PLATFORM =~ /linux/
37     gem 'sleepy_penguin', '2.0.0'
39     # is 2.6.32 new enough?
40     gem 'io_splice', '4.1.0' if `uname -r`.strip > '2.6.32'
41   end
42 end
44 $stdout.reopen(old_out)
45 # don't load the old Rev if it exists, Cool.io 1.0.0 is compatible with it,
46 # even for everything Revactor uses.
47 dirs = Dir["#{path}/gems/*-*/lib"]
48 dirs.delete_if { |x| x =~ %r{/rev-[\d\.]+/lib} }
49 puts dirs.map { |x| File.expand_path(x) }.join(':')