ruby-changes:46889
From: nobu <ko1@a...>
Date: Sat, 3 Jun 2017 18:18:48 +0900 (JST)
Subject: [ruby-changes:46889] nobu:r59004 (trunk): test_require.rb: untouch default internal encoding
nobu 2017-06-03 18:18:44 +0900 (Sat, 03 Jun 2017) New Revision: 59004 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59004 Log: test_require.rb: untouch default internal encoding * test/ruby/test_require.rb (assert_require_insecure_path): get rid of setting Encoding.default_internal, which affects load path conversion. Modified files: trunk/test/ruby/test_require.rb Index: test/ruby/test_require.rb =================================================================== --- test/ruby/test_require.rb (revision 59003) +++ test/ruby/test_require.rb (revision 59004) @@ -162,11 +162,14 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L162 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/