diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/ruby/test_require.rb | 14 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Sun Aug 11 22:57:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * test/ruby/test_require.rb (assert_require_nonascii_path): OS path + encoding on Windows is fixed, so encoding of __FILE__ should be it. + [ruby-core:56498] [Bug #8764] + Sun Aug 11 19:11:45 2013 Kouhei Sutou <kou@cozmixng.org> * test/rexml/parser/test_sax2.rb: Expand abbreviated class name. diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 26d7d74d96..42479e7518 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -75,6 +75,17 @@ class TestRequire < Test::Unit::TestCase assert_require_nonascii_path(encoding, bug8676) end + case RUBY_PLATFORM + when /cygwin/, /mswin/, /mingw/ + def self.ospath_encoding(path) + Encoding::UTF_8 + end + else + def self.ospath_encoding(path) + path.encoding + end + end + def assert_require_nonascii_path(encoding, bug) Dir.mktmpdir {|tmp| dir = "\u3042" * 5 @@ -94,8 +105,7 @@ class TestRequire < Test::Unit::TestCase $:.clear assert_nothing_raised(LoadError, bug) { assert(require(require_path), bug) - assert_equal(Encoding.find(encoding), $".last.encoding) - assert_equal(Encoding.find(encoding), $:.last.encoding, '[Bug #8753]') + assert_equal(self.class.ospath_encoding(require_path), $:.last.encoding, '[Bug #8753]') assert(!require(require_path), bug) } ensure |