[前][次][番号順一覧][スレッド一覧]

ruby-changes:69998

From: Nobuyoshi <ko1@a...>
Date: Wed, 1 Dec 2021 18:54:42 +0900 (JST)
Subject: [ruby-changes:69998] a84dc9d80d (master): [win32] skip example about STDIN encodings

https://git.ruby-lang.org/ruby.git/commit/?id=a84dc9d80d

From a84dc9d80d41db01db4623517ade928ee7f40e36 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 1 Dec 2021 16:30:06 +0900
Subject: [win32] skip example about STDIN encodings

---
 spec/ruby/language/predefined_spec.rb | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb
index 417afea5370..d3117502005 100644
--- a/spec/ruby/language/predefined_spec.rb
+++ b/spec/ruby/language/predefined_spec.rb
@@ -1208,13 +1208,24 @@ describe "The predefined global constant" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/language/predefined_spec.rb#L1208
   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
@@ -1229,15 +1240,6 @@ describe "The predefined global constant" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/language/predefined_spec.rb#L1240
              "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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]