about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-08 21:55:08 +0000
committerEric Wong <e@80x24.org>2023-01-09 05:07:31 +0000
commitb344bcc056e4c0dde8385bd7b4c60e20e04d9263 (patch)
treeee1476086d4c19db2f76bdbdbf927d2d198f7f38
parentc5b0ca668258f0e386bcb0b12cf3628899d6bc12 (diff)
downloadmwrap-b344bcc056e4c0dde8385bd7b4c60e20e04d9263.tar.gz
This tests commit
649a0d3e3578 (httpd: undefine ruby_snprintf alias for non-Ruby processes, 2023-01-08)
-rw-r--r--test/test_mwrap.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_mwrap.rb b/test/test_mwrap.rb
index 176dca6..e04fab5 100644
--- a/test/test_mwrap.rb
+++ b/test/test_mwrap.rb
@@ -6,6 +6,7 @@ require 'mwrap'
 require 'rbconfig'
 require 'tempfile'
 require 'io/wait'
+require 'tmpdir'
 
 class TestMwrap < Test::Unit::TestCase
   RB = "#{RbConfig::CONFIG['bindir']}/#{RbConfig::CONFIG['RUBY_INSTALL_NAME']}"
@@ -79,6 +80,15 @@ class TestMwrap < Test::Unit::TestCase
     assert_match(/\b0x[a-f0-9]+\b/s, dump, 'dump output has addresses')
   end
 
+  def test_spawn_non_ruby
+    Dir.mktmpdir do |dir|
+      sockdir = "#{dir}/sockdir"
+      env = @@env.merge('MWRAP' => "socket_dir:#{sockdir}")
+      out = IO.popen(env, %w(ls -alR), { chdir: dir }, &:read)
+      assert_match(/\b\d+\.sock\b/, out)
+    end
+  end
+
   def test_clear
     cmd = @@cmd + %w(
       -e ("0"*10000).clear