test_isolate: bump eventmachine and sinatra deps
[rainbows.git] / t / test_isolate.rb
blob734fcd52c1fea7629eeb6ce65ddd06956bc84ccc
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 lock = File.open(__FILE__, "rb")
17 lock.flock(File::LOCK_EX)
18 Isolate.now!(opts) do
19   gem 'kgio', '2.7.4'
20   gem 'kcar', '0.3.0'
21   gem 'raindrops', '0.10.0'
22   gem 'unicorn', '4.3.1'
24   if engine == "ruby"
25     gem 'sendfile', '1.1.0'
26     gem 'cool.io', '1.1.0'
28     gem 'eventmachine', '1.0.0'
29     gem 'sinatra', '1.3.3'
30     gem 'async_sinatra', '1.0.0'
32     gem 'neverblock', '0.1.6.2'
33   end
35   if defined?(::Fiber) && engine == "ruby"
36     gem 'revactor', '0.1.5'
37     gem 'rack-fiber_pool', '0.9.2'
38   end
40   if RUBY_PLATFORM =~ /linux/
41     gem 'sleepy_penguin', '3.1.0'
43     # is 2.6.32 new enough?
44     gem 'io_splice', '4.1.1' if `uname -r`.strip > '2.6.32'
45   end
46 end
48 $stdout.reopen(old_out)
50 # don't load the old Rev if it exists, Cool.io 1.0.0 is compatible with it,
51 # even for everything Revactor uses.
52 dirs = Dir["#{path}/gems/*-*/lib"]
53 dirs.delete_if { |x| x =~ %r{/rev-[\d\.]+/lib} }
54 puts dirs.map { |x| File.expand_path(x) }.join(':')