Skip to content

Commit

Permalink
[win32] skip example about STDIN encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 1, 2021
1 parent 37cd35a commit a84dc9d
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions spec/ruby/language/predefined_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1208,13 +1208,24 @@ def obj.foo2; yield; end
end

describe "STDIN" do
it "has the same external encoding as Encoding.default_external" do
STDIN.external_encoding.should equal(Encoding.default_external)
end
platform_is_not :windows do
it "has the same external encoding as Encoding.default_external" do
STDIN.external_encoding.should equal(Encoding.default_external)
end

it "has the same external encoding as Encoding.default_external when that encoding is changed" do
Encoding.default_external = Encoding::ISO_8859_16
STDIN.external_encoding.should equal(Encoding::ISO_8859_16)
end

it "has the same external encoding as Encoding.default_external when that encoding is changed" do
Encoding.default_external = Encoding::ISO_8859_16
STDIN.external_encoding.should equal(Encoding::ISO_8859_16)
it "has nil for the internal encoding" do
STDIN.internal_encoding.should be_nil
end

it "has nil for the internal encoding despite Encoding.default_internal being changed" do
Encoding.default_internal = Encoding::IBM437
STDIN.internal_encoding.should be_nil
end
end

it "has the encodings set by #set_encoding" do
Expand All @@ -1229,15 +1240,6 @@ def obj.foo2; yield; end
"p [STDIN.external_encoding.name, STDIN.internal_encoding.name]"
ruby_exe(code).chomp.should == %{["IBM775", "IBM866"]}
end

it "has nil for the internal encoding" do
STDIN.internal_encoding.should be_nil
end

it "has nil for the internal encoding despite Encoding.default_internal being changed" do
Encoding.default_internal = Encoding::IBM437
STDIN.internal_encoding.should be_nil
end
end

describe "STDOUT" do
Expand Down

0 comments on commit a84dc9d

Please sign in to comment.