summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_require.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 12c6ba9891..41173b002d 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -162,11 +162,14 @@ class TestRequire < Test::Unit::TestCase
File.chmod(0777, File.dirname(require_path))
ospath = (require_path.encode('filesystem') rescue
require_path.encode(self.class.ospath_encoding(require_path)))
- assert_warn(/Insecure world writable dir/) do
- assert_raise_with_message(SecurityError, "loading from unsafe path #{ospath}") do
+ e = nil
+ stderr = EnvUtil.verbose_warning do
+ e = assert_raise(SecurityError) do
SECURITY_WARNING.call(require_path)
end
end
+ assert_include(e.message, "loading from unsafe path")
+ assert_include(stderr, "Insecure world writable dir")
}
end