From cb80ee7a4a3967be3a0ce687ec76522f1680600b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 26 Oct 2022 21:20:17 +0900 Subject: [PATCH] [ruby/tmpdir] Warnings should contain the environment variable name --- test/test_tmpdir.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_tmpdir.rb b/test/test_tmpdir.rb index 1adb6a70b7..eada416f6f 100644 --- a/test/test_tmpdir.rb +++ b/test/test_tmpdir.rb @@ -23,14 +23,14 @@ class TestTmpdir < Test::Unit::TestCase ENV[e] = tmpdirx assert_not_equal(tmpdirx, assert_warn('') {Dir.tmpdir}) File.write(tmpdirx, "") - assert_not_equal(tmpdirx, assert_warn(/not a directory/) {Dir.tmpdir}) + assert_not_equal(tmpdirx, assert_warn(/\A#{e} is not a directory/) {Dir.tmpdir}) File.unlink(tmpdirx) ENV[e] = tmpdir assert_equal(tmpdir, Dir.tmpdir) File.chmod(0555, tmpdir) - assert_not_equal(tmpdir, assert_warn(/not writable/) {Dir.tmpdir}) + assert_not_equal(tmpdir, assert_warn(/\A#{e} is not writable/) {Dir.tmpdir}) File.chmod(0777, tmpdir) - assert_not_equal(tmpdir, assert_warn(/world-writable/) {Dir.tmpdir}) + assert_not_equal(tmpdir, assert_warn(/\A#{e} is world-writable/) {Dir.tmpdir}) newdir = Dir.mktmpdir("d", tmpdir) do |dir| assert_file.directory? dir assert_equal(tmpdir, File.dirname(dir))