diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-04-28 23:20:11 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-04-28 23:20:11 +0200 |
commit | 79671ec57e59091260a0bc3d40a31d31d9c72a94 (patch) | |
tree | 2f59a8727b8f63f9e79d50352fa4f78a7cc00234 /spec/ruby/core/env/shared | |
parent | 994833085ae06afbe94d30ab183d80e0234fbe14 (diff) | |
download | ruby-79671ec57e59091260a0bc3d40a31d31d9c72a94.tar.gz |
Update to ruby/spec@7de852d
Diffstat (limited to 'spec/ruby/core/env/shared')
-rw-r--r-- | spec/ruby/core/env/shared/each.rb | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/spec/ruby/core/env/shared/each.rb b/spec/ruby/core/env/shared/each.rb index d6cbc93f9a..4039dd1f83 100644 --- a/spec/ruby/core/env/shared/each.rb +++ b/spec/ruby/core/env/shared/each.rb @@ -25,39 +25,37 @@ describe :env_each, shared: true do end it_should_behave_like :enumeratorized_with_origin_size - with_feature :encoding do - describe "with encoding" do - before :each do - @external = Encoding.default_external - @internal = Encoding.default_internal + describe "with encoding" do + before :each do + @external = Encoding.default_external + @internal = Encoding.default_internal - Encoding.default_external = Encoding::ASCII_8BIT + Encoding.default_external = Encoding::ASCII_8BIT - @locale_encoding = Encoding.find "locale" - end + @locale_encoding = Encoding.find "locale" + end - after :each do - Encoding.default_external = @external - Encoding.default_internal = @internal - end + after :each do + Encoding.default_external = @external + Encoding.default_internal = @internal + end - it "uses the locale encoding when Encoding.default_internal is nil" do - Encoding.default_internal = nil + it "uses the locale encoding when Encoding.default_internal is nil" do + Encoding.default_internal = nil - ENV.send(@method) do |key, value| - key.encoding.should equal(@locale_encoding) - value.encoding.should equal(@locale_encoding) - end + ENV.send(@method) do |key, value| + key.encoding.should equal(@locale_encoding) + value.encoding.should equal(@locale_encoding) end + end - it "transcodes from the locale encoding to Encoding.default_internal if set" do - Encoding.default_internal = internal = Encoding::IBM437 + it "transcodes from the locale encoding to Encoding.default_internal if set" do + Encoding.default_internal = internal = Encoding::IBM437 - ENV.send(@method) do |key, value| - key.encoding.should equal(internal) - if value.ascii_only? - value.encoding.should equal(internal) - end + ENV.send(@method) do |key, value| + key.encoding.should equal(internal) + if value.ascii_only? + value.encoding.should equal(internal) end end end |