diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-01 21:14:58 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-01 21:55:51 +0900 |
commit | ab516e263c06fbd755d4805ad529c32b1b8292b5 (patch) | |
tree | f709104c313268e8443174ab03242fc1e8f6c39c /spec/ruby/core/env/shared | |
parent | 4e03a7298b3a99de9c57f9a4934d38445cad1b10 (diff) | |
download | ruby-ab516e263c06fbd755d4805ad529c32b1b8292b5.tar.gz |
[ruby/spec] Fix failures with LC_ALL=C
https://github.com/ruby/spec/commit/51047687c0
https://github.com/ruby/spec/commit/2b87b467cc
Diffstat (limited to 'spec/ruby/core/env/shared')
-rw-r--r-- | spec/ruby/core/env/shared/each.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/env/shared/to_hash.rb | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/spec/ruby/core/env/shared/each.rb b/spec/ruby/core/env/shared/each.rb index eb375046d6..d901b854c4 100644 --- a/spec/ruby/core/env/shared/each.rb +++ b/spec/ruby/core/env/shared/each.rb @@ -35,8 +35,6 @@ describe :env_each, shared: true do @internal = Encoding.default_internal Encoding.default_external = Encoding::BINARY - - @locale_encoding = Encoding.find "locale" end after :each do @@ -48,8 +46,8 @@ describe :env_each, shared: true do Encoding.default_internal = nil ENV.send(@method) do |key, value| - key.encoding.should equal(@locale_encoding) - value.encoding.should equal(@locale_encoding) + key.should.be_locale_env + value.should.be_locale_env end end diff --git a/spec/ruby/core/env/shared/to_hash.rb b/spec/ruby/core/env/shared/to_hash.rb index bfa5699e8d..a0d4d7ce69 100644 --- a/spec/ruby/core/env/shared/to_hash.rb +++ b/spec/ruby/core/env/shared/to_hash.rb @@ -15,11 +15,11 @@ describe :env_to_hash, shared: true do end it "uses the locale encoding for keys" do - ENV.send(@method).keys.all? {|k| k.encoding == Encoding.find('locale') }.should be_true + ENV.send(@method).keys.each {|k| k.should.be_locale_env } end it "uses the locale encoding for values" do - ENV.send(@method).values.all? {|v| v.encoding == Encoding.find('locale') }.should be_true + ENV.send(@method).values.each {|k| k.should.be_locale_env } end it "duplicates the ENV when converting to a Hash" do |