about summary refs log tree commit homepage
path: root/t/t0006.ru
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-06-15 23:17:33 +0000
committerEric Wong <normalperson@yhbt.net>2010-06-15 23:25:17 +0000
commit13dc5b88cde691cc4e105de04ebb7804ae633ae6 (patch)
treec66df3ad8dfa2b5dd3e9517adf9696e82bfbd102 /t/t0006.ru
parent43175d4fe36f91a28563a8cbf46160ee076de31c (diff)
downloadunicorn-13dc5b88cde691cc4e105de04ebb7804ae633ae6.tar.gz
While log reopening worked reliably for newly-created File
objects in the unit tests, the $stderr and $stdout handles that
get redirected did not get reopened reliably under Rubinius.

We work around this by relying on Rubinius internals and
directly setting the @path instance variable.  This is harmless
for MRI and should be harmless for other any other Ruby
implementations we'll eventually support.

ref: http://github.com/evanphx/rubinius/issues/360
Diffstat (limited to 't/t0006.ru')
-rw-r--r--t/t0006.ru13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t0006.ru b/t/t0006.ru
new file mode 100644
index 0000000..c39e8f6
--- /dev/null
+++ b/t/t0006.ru
@@ -0,0 +1,13 @@
+use Rack::ContentLength
+use Rack::ContentType, "text/plain"
+run lambda { |env|
+
+  # our File objects for stderr/stdout should always have #path
+  # and be sync=true
+  ok = $stderr.sync &&
+       $stdout.sync &&
+       String === $stderr.path &&
+       String === $stdout.path
+
+  [ 200, {}, [ "#{ok}\n" ] ]
+}