mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] test spawning non-Ruby process with socket_dir
@ 2023-01-08 21:55 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-01-08 21:55 UTC (permalink / raw)
  To: mwrap-public

This tests commit
649a0d3e3578 (httpd: undefine ruby_snprintf alias for non-Ruby processes, 2023-01-08)
---
 test/test_mwrap.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-08 21:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-08 21:55 [PATCH] test spawning non-Ruby process with socket_dir Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mwrap.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).