aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_env.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_env.rb')
-rw-r--r--test/ruby/test_env.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index 7735b53045..ddfce136a4 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -369,7 +369,8 @@ class TestEnv < Test::Unit::TestCase
assert_equal("foo", v)
end
assert_invalid_env {|var| ENV.assoc(var)}
- assert_equal(Encoding.find("locale"), v.encoding)
+ encoding = /mswin|mingw/ =~ RUBY_PLATFORM ? Encoding::UTF_8 : Encoding.find("locale")
+ assert_equal(encoding, v.encoding)
end
def test_has_value2
@@ -579,15 +580,13 @@ class TestEnv < Test::Unit::TestCase
end;
end
- if Encoding.find("locale") == Encoding::UTF_8
- def test_utf8
- text = "testing \u{e5 e1 e2 e4 e3 101 3042}"
- test = ENV["test"]
- ENV["test"] = text
- assert_equal text, ENV["test"]
- ensure
- ENV["test"] = test
- end
+ def test_utf8
+ text = "testing \u{e5 e1 e2 e4 e3 101 3042}"
+ test = ENV["test"]
+ ENV["test"] = text
+ assert_equal text, ENV["test"]
+ ensure
+ ENV["test"] = test
end
end
end