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

ruby-changes:55607

From: Benoit <ko1@a...>
Date: Mon, 29 Apr 2019 06:20:56 +0900 (JST)
Subject: [ruby-changes:55607] Benoit Daloze:79671ec57e (trunk): Update to ruby/spec@7de852d

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

From 79671ec57e59091260a0bc3d40a31d31d9c72a94 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sun, 28 Apr 2019 23:20:11 +0200
Subject: Update to ruby/spec@7de852d


diff --git a/spec/ruby/core/argf/gets_spec.rb b/spec/ruby/core/argf/gets_spec.rb
index 5863147..cc7673b 100644
--- a/spec/ruby/core/argf/gets_spec.rb
+++ b/spec/ruby/core/argf/gets_spec.rb
@@ -26,25 +26,23 @@ describe "ARGF.gets" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/argf/gets_spec.rb#L26
     end
   end
 
-  with_feature :encoding do
-    before :each do
-      @external = Encoding.default_external
-      @internal = Encoding.default_internal
+  before :each do
+    @external = Encoding.default_external
+    @internal = Encoding.default_internal
 
-      Encoding.default_external = Encoding::UTF_8
-      Encoding.default_internal = nil
-    end
+    Encoding.default_external = Encoding::UTF_8
+    Encoding.default_internal = nil
+  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 "reads the contents of the file with default encoding" do
-      Encoding.default_external = Encoding::US_ASCII
-      argf [@file1_name, @file2_name] do
-        @argf.gets.encoding.should == Encoding::US_ASCII
-      end
+  it "reads the contents of the file with default encoding" do
+    Encoding.default_external = Encoding::US_ASCII
+    argf [@file1_name, @file2_name] do
+      @argf.gets.encoding.should == Encoding::US_ASCII
     end
   end
 
diff --git a/spec/ruby/core/argf/read_spec.rb b/spec/ruby/core/argf/read_spec.rb
index b889605..bbeef95 100644
--- a/spec/ruby/core/argf/read_spec.rb
+++ b/spec/ruby/core/argf/read_spec.rb
@@ -62,26 +62,24 @@ describe "ARGF.read" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/argf/read_spec.rb#L62
     end
   end
 
-  with_feature :encoding do
 
-    before :each do
-      @external = Encoding.default_external
-      @internal = Encoding.default_internal
+  before :each do
+    @external = Encoding.default_external
+    @internal = Encoding.default_internal
 
-      Encoding.default_external = Encoding::UTF_8
-      Encoding.default_internal = nil
-    end
+    Encoding.default_external = Encoding::UTF_8
+    Encoding.default_internal = nil
+  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 "reads the contents of the file with default encoding" do
-      Encoding.default_external = Encoding::US_ASCII
-      argf [@file1_name, @file2_name] do
-        @argf.read.encoding.should == Encoding::US_ASCII
-      end
+  it "reads the contents of the file with default encoding" do
+    Encoding.default_external = Encoding::US_ASCII
+    argf [@file1_name, @file2_name] do
+      @argf.read.encoding.should == Encoding::US_ASCII
     end
   end
 end
diff --git a/spec/ruby/core/dir/shared/glob.rb b/spec/ruby/core/dir/shared/glob.rb
index 19f457e..af587dd 100644
--- a/spec/ruby/core/dir/shared/glob.rb
+++ b/spec/ruby/core/dir/shared/glob.rb
@@ -11,11 +11,9 @@ describe :dir_glob, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/glob.rb#L11
     DirSpecs.delete_mock_dirs
   end
 
-  with_feature :encoding do
-    it "raises an Encoding::CompatibilityError if the argument encoding is not compatible with US-ASCII" do
-      pattern = "file*".force_encoding Encoding::UTF_16BE
-      lambda { Dir.send(@method, pattern) }.should raise_error(Encoding::CompatibilityError)
-    end
+  it "raises an Encoding::CompatibilityError if the argument encoding is not compatible with US-ASCII" do
+    pattern = "file*".force_encoding Encoding::UTF_16BE
+    lambda { Dir.send(@method, pattern) }.should raise_error(Encoding::CompatibilityError)
   end
 
   it "calls #to_path to convert a pattern" do
diff --git a/spec/ruby/core/dir/shared/path.rb b/spec/ruby/core/dir/shared/path.rb
index fe2d61e..494dcca 100644
--- a/spec/ruby/core/dir/shared/path.rb
+++ b/spec/ruby/core/dir/shared/path.rb
@@ -18,15 +18,13 @@ describe :dir_path, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/path.rb#L18
     dir.send(@method).should == DirSpecs.mock_dir
   end
 
-  with_feature :encoding do
-    it "returns a String with the same encoding as the argument to .open" do
-      path = DirSpecs.mock_dir.force_encoding Encoding::IBM866
-      dir = Dir.open path
-      begin
-        dir.send(@method).encoding.should equal(Encoding::IBM866)
-      ensure
-        dir.close
-      end
+  it "returns a String with the same encoding as the argument to .open" do
+    path = DirSpecs.mock_dir.force_encoding Encoding::IBM866
+    dir = Dir.open path
+    begin
+      dir.send(@method).encoding.should equal(Encoding::IBM866)
+    ensure
+      dir.close
     end
   end
 end
diff --git a/spec/ruby/core/dir/shared/pwd.rb b/spec/ruby/core/dir/shared/pwd.rb
index 5f041a9..94fc2fa 100644
--- a/spec/ruby/core/dir/shared/pwd.rb
+++ b/spec/ruby/core/dir/shared/pwd.rb
@@ -1,8 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/pwd.rb#L1
 describe :dir_pwd, shared: true do
-  with_feature :encoding do
-    before :each do
-      @fs_encoding = Encoding.find('filesystem')
-    end
+  before :each do
+    @fs_encoding = Encoding.find('filesystem')
   end
 
   it "returns the current working directory" do
@@ -36,14 +34,12 @@ describe :dir_pwd, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/pwd.rb#L34
     end
   end
 
-  with_feature :encoding do
-    it "returns a String with the filesystem encoding" do
-      enc = Dir.send(@method).encoding
-      if @fs_encoding == Encoding::US_ASCII
-        [Encoding::US_ASCII, Encoding::ASCII_8BIT].should include(enc)
-      else
-        enc.should equal(@fs_encoding)
-      end
+  it "returns a String with the filesystem encoding" do
+    enc = Dir.send(@method).encoding
+    if @fs_encoding == Encoding::US_ASCII
+      [Encoding::US_ASCII, Encoding::ASCII_8BIT].should include(enc)
+    else
+      enc.should equal(@fs_encoding)
     end
   end
 end
diff --git a/spec/ruby/core/encoding/aliases_spec.rb b/spec/ruby/core/encoding/aliases_spec.rb
index 22e4510..7861579 100644
--- a/spec/ruby/core/encoding/aliases_spec.rb
+++ b/spec/ruby/core/encoding/aliases_spec.rb
@@ -1,45 +1,43 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/encoding/aliases_spec.rb#L1
 require_relative '../../spec_helper'
 
-with_feature :encoding do
-  describe "Encoding.aliases" do
-    it "returns a Hash" do
-      Encoding.aliases.should be_an_instance_of(Hash)
-    end
+describe "Encoding.aliases" do
+  it "returns a Hash" do
+    Encoding.aliases.should be_an_instance_of(Hash)
+  end
 
-    it "has Strings as keys" do
-      Encoding.aliases.keys.each do |key|
-        key.should be_an_instance_of(String)
-      end
+  it "has Strings as keys" do
+    Encoding.aliases.keys.each do |key|
+      key.should be_an_instance_of(String)
     end
+  end
 
-    it "has Strings as values" do
-      Encoding.aliases.values.each do |value|
-        value.should be_an_instance_of(String)
-      end
+  it "has Strings as values" do
+    Encoding.aliases.values.each do |value|
+      value.should be_an_instance_of(String)
     end
+  end
 
-    it "has alias names as its keys" do
-      Encoding.aliases.key?('BINARY').should be_true
-      Encoding.aliases.key?('ASCII').should be_true
-    end
+  it "has alias names as its keys" do
+    Encoding.aliases.key?('BINARY').should be_true
+    Encoding.aliases.key?('ASCII').should be_true
+  end
 
-    it "has the names of the aliased encoding as its values" do
-      Encoding.aliases['BINARY'].should == 'ASCII-8BIT'
-      Encoding.aliases['ASCII'].should == 'US-ASCII'
-    end
+  it "has the names of the aliased encoding as its values" do
+    Encoding.aliases['BINARY'].should == 'ASCII-8BIT'
+    Encoding.aliases['ASCII'].should == 'US-ASCII'
+  end
 
-    it "has an 'external' key with the external default encoding as its value" do
-      Encoding.aliases['external'].should == Encoding.default_external.name
-    end
+  it "has an 'external' key with the external default encoding as its value" do
+    Encoding.aliases['external'].should == Encoding.default_external.name
+  end
 
-    it "has a 'locale' key and its value equals the name of the encoding found by the locale charmap" do
-      Encoding.aliases['locale'].should == Encoding.find(Encoding.locale_charmap).name
-    end
+  it "has a 'locale' key and its value equals the name of the encoding found by the locale charmap" do
+    Encoding.aliases['locale'].should == Encoding.find(Encoding.locale_charmap).name
+  end
 
-    it "only contains valid aliased encodings" do
-      Encoding.aliases.each do |aliased, original|
-        Encoding.find(aliased).should == Encoding.find(original)
-      end
+  it "only contains valid aliased encodings" do
+    Encoding.aliases.each do |aliased, original|
+      Encoding.find(aliased).should == Encoding.find(original)
     end
   end
 end
diff --git a/spec/ruby/core/encoding/ascii_compatible_spec.rb b/spec/ruby/core/encoding/ascii_compatible_spec.rb
index 31ac753..4804300 100644
--- a/spec/ruby/core/encoding/ascii_compatible_spec.rb
+++ b/spec/ruby/core/encoding/ascii_compatible_spec.rb
@@ -1,13 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/encoding/ascii_compatible_spec.rb#L1
 require_relative '../../spec_helper'
 
-with_feature :encoding do
-  describe "Encoding#ascii_compatible?" do
-    it "returns true if self represents an ASCII-compatible encoding" do
-      Encoding::UTF_8.ascii_compatible?.should be_true
-    end
+describe "Encoding#ascii_compatible?" do
+  it "retur (... truncated)

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

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