test/test_detect_general.rb in locale-0.9.0 vs test/test_detect_general.rb in locale-2.0.0
- old
+ new
@@ -57,11 +57,11 @@
assert_equal Locale::Tag::Posix.new("ja", "JP", "eucJP"), lang
assert_equal "eucJP", Locale.charset
end
- def test_lang
+ def test_lang_complex
ENV["LC_ALL"] = "zh_CN.UTF-8" # Ignored.
ENV["LC_MESSAGES"] = "ko_KR.UTF-8" #Ingored.
ENV["LANG"] = "en_US.UTF-8" # Ignored.
ENV["LANGUAGE"] ="ja_JP.eucJP:zh_CN.UTF-8"
@@ -111,12 +111,16 @@
assert_equal "cs", lang.language
assert_equal "CZ", lang.region
assert_equal nil, lang.charset
assert_equal Locale::Tag::Posix.new("cs", "CZ"), lang
+=begin
+ This test doesn't work any environment such as Ubuntu.
+ Because this method gets the system locale via "locale -a" command.
if /linux|bsd/ =~ RUBY_PLATFORM
assert_equal "ISO-8859-2", Locale.charset
end
+=end
end
def test_default
Locale.set_default("yo_NG")
assert_equal Locale::Tag.parse("yo_NG"), Locale.default