spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on Android

nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to
LC_ALL=C.
This commit is contained in:
Yusuke Endoh 2020-02-13 22:58:15 +09:00
Родитель a11fa7d8cd
Коммит 022268ae00
1 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -7,6 +7,7 @@ describe "Encoding.locale_charmap" do
# FIXME: Get this working on Windows
platform_is :linux do
platform_is_not :android do
it "returns a value based on the LC_ALL environment variable" do
old_lc_all = ENV['LC_ALL']
ENV['LC_ALL'] = 'C'
@ -14,6 +15,7 @@ describe "Encoding.locale_charmap" do
ENV['LC_ALL'] = old_lc_all
end
end
end
platform_is :freebsd, :openbsd, :darwin do
it "returns a value based on the LC_ALL environment variable" do
@ -33,6 +35,15 @@ describe "Encoding.locale_charmap" do
end
end
platform_is :android do
it "always returns UTF-8" do
old_lc_all = ENV['LC_ALL']
ENV['LC_ALL'] = 'C'
ruby_exe("print Encoding.locale_charmap").should == 'UTF-8'
ENV['LC_ALL'] = old_lc_all
end
end
platform_is :bsd, :darwin, :linux do
it "is unaffected by assigning to ENV['LC_ALL'] in the same process" do
old_charmap = Encoding.locale_charmap