about summary refs log tree commit homepage
path: root/t/test_isolate_cramp.rb
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 /t/test_isolate_cramp.rb
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...
Diffstat (limited to 't/test_isolate_cramp.rb')
-rw-r--r--t/test_isolate_cramp.rb26
1 files changed, 26 insertions, 0 deletions
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(':')