summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-10-11 09:44:52 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2025-10-11 11:01:56 +0900
commitfa883a4de89c40d152c28ee0de83ff05b40059df (patch)
treefcb08c814a35e55b587090ba2dcac1e765701cda
parentb868beea10096df8e54c8b1175659f491a0b03dd (diff)
test_commit_email.rb: Simply use sh
`env` on macOS resets DYLD environment variables that are needed to run ruby configured with `--enable-load-relative`. Use simple commands instead, and `/bin/sh` that is specified in POSIX is more portable than `/usr/bin/env`.
-rw-r--r--tool/test/test_commit_email.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/tool/test/test_commit_email.rb b/tool/test/test_commit_email.rb
index efd45022be..b948987ed9 100644
--- a/tool/test/test_commit_email.rb
+++ b/tool/test/test_commit_email.rb
@@ -20,12 +20,11 @@ class TestCommitEmail < Test::Unit::TestCase
end
@sendmail = File.join(Dir.mktmpdir, 'sendmail')
- File.write(@sendmail, <<~SENDMAIL)
- #!/usr/bin/env ruby
- print #{STDIN_DELIMITER.dump}
- puts STDIN.read
+ File.write(@sendmail, <<~SENDMAIL, mode: "wx", perm: 0755)
+ #!/bin/sh
+ echo #{STDIN_DELIMITER.chomp.dump}
+ exec cat
SENDMAIL
- FileUtils.chmod(0755, @sendmail)
@commit_email = File.expand_path('../../tool/commit-email.rb', __dir__)
end