summaryrefslogtreecommitdiff
path: root/spec/ruby/core/encoding
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-02-13 22:58:15 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-02-13 23:00:03 +0900
commit022268ae009bd87b13e1f5ee46011b7142987d57 (patch)
tree403e991aba7490d168e0e3b08154eefc755001d0 /spec/ruby/core/encoding
parenta11fa7d8cd424e60b34a1c03cc18abee17203576 (diff)
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.
Diffstat (limited to 'spec/ruby/core/encoding')
-rw-r--r--spec/ruby/core/encoding/locale_charmap_spec.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/spec/ruby/core/encoding/locale_charmap_spec.rb b/spec/ruby/core/encoding/locale_charmap_spec.rb
index 5963a8beb5..8143b9083a 100644
--- a/spec/ruby/core/encoding/locale_charmap_spec.rb
+++ b/spec/ruby/core/encoding/locale_charmap_spec.rb
@@ -7,11 +7,13 @@ describe "Encoding.locale_charmap" do
# FIXME: Get this working on Windows
platform_is :linux do
- it "returns a value based on the LC_ALL environment variable" do
- old_lc_all = ENV['LC_ALL']
- ENV['LC_ALL'] = 'C'
- ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968'
- ENV['LC_ALL'] = old_lc_all
+ 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'
+ ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968'
+ ENV['LC_ALL'] = old_lc_all
+ end
end
end
@@ -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