about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-07 11:47:05 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-07 11:52:03 -0800
commitf1893ae9786db250fd95def1cf958f2351cb84c5 (patch)
tree4a6f9d44aae7334b2ae7f9275a1088ef8c263f8f
parent360ba90a9a50b5aabd1c65d51034c7ebe77e36ef (diff)
downloadrainbows-f1893ae9786db250fd95def1cf958f2351cb84c5.tar.gz
We need to split out Cramp tests to Isolate to a
different path, which sucks, but oh well.  Cramp
hasn't had a release in a while...
-rwxr-xr-xt/t0500-cramp-streaming.sh2
-rwxr-xr-xt/t0501-cramp-rainsocket.sh2
-rw-r--r--t/test_isolate.rb3
-rw-r--r--t/test_isolate_cramp.rb26
4 files changed, 31 insertions, 2 deletions
diff --git a/t/t0500-cramp-streaming.sh b/t/t0500-cramp-streaming.sh
index b97853d..81fd55d 100755
--- a/t/t0500-cramp-streaming.sh
+++ b/t/t0500-cramp-streaming.sh
@@ -7,6 +7,8 @@ EventMachine) ;;
         exit 0
         ;;
 esac
+RUBYLIB=$($RUBY test_isolate_cramp.rb):$RUBYLIB
+export RUBYLIB
 require_check cramp Cramp::VERSION
 
 t_plan 7 "streaming test for Cramp"
diff --git a/t/t0501-cramp-rainsocket.sh b/t/t0501-cramp-rainsocket.sh
index a64145a..762d5ac 100755
--- a/t/t0501-cramp-rainsocket.sh
+++ b/t/t0501-cramp-rainsocket.sh
@@ -7,6 +7,8 @@ EventMachine) ;;
         exit 0
         ;;
 esac
+RUBYLIB=$($RUBY test_isolate_cramp.rb):$RUBYLIB
+export RUBYLIB
 require_check cramp Cramp::VERSION
 
 t_plan 4 "WebSocket monkey patch validity test for Cramp"
diff --git a/t/test_isolate.rb b/t/test_isolate.rb
index d33baed..447e84f 100644
--- a/t/test_isolate.rb
+++ b/t/test_isolate.rb
@@ -14,7 +14,7 @@ old_out = $stdout.dup
 $stdout.reopen($stderr)
 
 Isolate.now!(opts) do
-  gem 'rack', '1.1.0' # Cramp currently requires ~> 1.1.0
+  gem 'rack', '1.2.1'
   gem 'kgio', '2.1.1'
   gem 'unicorn', '3.3.0'
   gem 'kcar', '0.1.1'
@@ -30,7 +30,6 @@ Isolate.now!(opts) do
     gem 'async_sinatra', '0.2.1'
 
     gem 'neverblock', '0.1.6.2'
-    gem 'cramp', '0.11'
   end
 
   if defined?(::Fiber) && engine == "ruby"
diff --git a/t/test_isolate_cramp.rb b/t/test_isolate_cramp.rb
new file mode 100644
index 0000000..2dbb606
--- /dev/null
+++ b/t/test_isolate_cramp.rb
@@ -0,0 +1,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.11'
+  end
+end
+
+$stdout.reopen(old_out)
+dirs = Dir["#{path}/gems/*-*/lib"]
+puts dirs.map { |x| File.expand_path(x) }.join(':')