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

ruby-changes:58023

From: Benoit <ko1@a...>
Date: Mon, 30 Sep 2019 02:14:05 +0900 (JST)
Subject: [ruby-changes:58023] 070cbe22b7 (master): Update to ruby/spec@34e6246

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

From 070cbe22b70ec2bec36c7cfc84b726510afa306f Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sun, 29 Sep 2019 19:13:37 +0200
Subject: Update to ruby/spec@34e6246


diff --git a/spec/ruby/core/dir/chdir_spec.rb b/spec/ruby/core/dir/chdir_spec.rb
index e9b82743..729ac40 100644
--- a/spec/ruby/core/dir/chdir_spec.rb
+++ b/spec/ruby/core/dir/chdir_spec.rb
@@ -95,8 +95,8 @@ describe "Dir.chdir" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/chdir_spec.rb#L95
   it "raises an Errno::ENOENT if the original directory no longer exists" do
     dir1 = tmp('/testdir1')
     dir2 = tmp('/testdir2')
-    File.exist?(dir1).should == false
-    File.exist?(dir2).should == false
+    File.should_not.exist?(dir1)
+    File.should_not.exist?(dir2)
     Dir.mkdir dir1
     Dir.mkdir dir2
     begin
diff --git a/spec/ruby/core/dir/mkdir_spec.rb b/spec/ruby/core/dir/mkdir_spec.rb
index 58767a5..c6e2f16 100644
--- a/spec/ruby/core/dir/mkdir_spec.rb
+++ b/spec/ruby/core/dir/mkdir_spec.rb
@@ -14,9 +14,9 @@ describe "Dir.mkdir" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/mkdir_spec.rb#L14
     DirSpecs.clear_dirs
 
     begin
-      File.exist?('nonexisting').should == false
+      File.should_not.exist?('nonexisting')
       Dir.mkdir 'nonexisting'
-      File.exist?('nonexisting').should == true
+      File.should.exist?('nonexisting')
       platform_is_not :windows do
         Dir.mkdir 'default_perms'
         a = File.stat('default_perms').mode
diff --git a/spec/ruby/core/dir/shared/chroot.rb b/spec/ruby/core/dir/shared/chroot.rb
index 93699f9..b14a433 100644
--- a/spec/ruby/core/dir/shared/chroot.rb
+++ b/spec/ruby/core/dir/shared/chroot.rb
@@ -16,7 +16,7 @@ describe :dir_chroot_as_root, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/chroot.rb#L16
 
   it "can be used to change the process' root directory" do
     -> { Dir.send(@method, File.dirname(__FILE__)) }.should_not raise_error
-    File.exist?("/#{File.basename(__FILE__)}").should be_true
+    File.should.exist?("/#{File.basename(__FILE__)}")
   end
 
   it "returns 0 if successful" do
@@ -29,8 +29,8 @@ describe :dir_chroot_as_root, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/chroot.rb#L29
 
   it "can be escaped from with ../" do
     Dir.send(@method, @real_root)
-    File.exist?(@ref_dir).should be_true
-    File.exist?("/#{File.basename(__FILE__)}").should be_false
+    File.should.exist?(@ref_dir)
+    File.should_not.exist?("/#{File.basename(__FILE__)}")
   end
 
   it "calls #to_path on non-String argument" do
diff --git a/spec/ruby/core/dir/shared/exist.rb b/spec/ruby/core/dir/shared/exist.rb
index fbd2c98..765d1b6 100644
--- a/spec/ruby/core/dir/shared/exist.rb
+++ b/spec/ruby/core/dir/shared/exist.rb
@@ -39,7 +39,7 @@ describe :dir_exist, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/exist.rb#L39
   end
 
   it "returns false if the argument exists but is a file" do
-    File.exist?(__FILE__).should be_true
+    File.should.exist?(__FILE__)
     Dir.send(@method, __FILE__).should be_false
   end
 
diff --git a/spec/ruby/core/dir/shared/glob.rb b/spec/ruby/core/dir/shared/glob.rb
index 6267514..b47e23b 100644
--- a/spec/ruby/core/dir/shared/glob.rb
+++ b/spec/ruby/core/dir/shared/glob.rb
@@ -331,14 +331,14 @@ describe :dir_glob, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/shared/glob.rb#L331
 
       it "returns [] if specified path does not exist" do
         path = File.join(@mock_dir, "fake-name")
-        File.exist?(path).should == false
+        File.should_not.exist?(path)
 
         Dir.send(@method, "*", base: path).should == []
       end
 
       it "returns [] if specified path is a file" do
         path = File.join(@mock_dir, "a/b/x")
-        File.exist?(path).should == true
+        File.should.exist?(path)
 
         Dir.send(@method, "*", base: path).should == []
       end
diff --git a/spec/ruby/core/file/link_spec.rb b/spec/ruby/core/file/link_spec.rb
index 11d4c8d..cc63c76 100644
--- a/spec/ruby/core/file/link_spec.rb
+++ b/spec/ruby/core/file/link_spec.rb
@@ -16,7 +16,7 @@ describe "File.link" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/link_spec.rb#L16
   platform_is_not :windows do
     it "link a file with another" do
       File.link(@file, @link).should == 0
-      File.exist?(@link).should == true
+      File.should.exist?(@link)
       File.identical?(@file, @link).should == true
     end
 
diff --git a/spec/ruby/core/file/new_spec.rb b/spec/ruby/core/file/new_spec.rb
index e99f6ba..004f785 100644
--- a/spec/ruby/core/file/new_spec.rb
+++ b/spec/ruby/core/file/new_spec.rb
@@ -17,13 +17,13 @@ describe "File.new" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/new_spec.rb#L17
   it "returns a new File with mode string" do
     @fh = File.new(@file, 'w')
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "returns a new File with mode num" do
     @fh = File.new(@file, @flags)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "returns a new File with modus num and permissions" do
@@ -34,7 +34,7 @@ describe "File.new" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/new_spec.rb#L34
     platform_is_not :windows do
       File.stat(@file).mode.to_s(8).should == "100744"
     end
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "creates the file and returns writable descriptor when called with 'w' mode and r-o permissions" do
@@ -48,7 +48,7 @@ describe "File.new" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/new_spec.rb#L48
     ensure
       f.close
     end
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
     File.read(@file).should == "test\n"
   end
 
@@ -75,13 +75,13 @@ describe "File.new" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/new_spec.rb#L75
     fh_copy = File.new(@fh.fileno)
     fh_copy.autoclose = false
     fh_copy.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "creates a new file when use File::EXCL mode" do
     @fh = File.new(@file, File::EXCL)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "raises an Errorno::EEXIST if the file exists when create a new file with File::CREAT|File::EXCL" do
@@ -91,46 +91,46 @@ describe "File.new" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/new_spec.rb#L91
   it "creates a new file when use File::WRONLY|File::APPEND mode" do
     @fh = File.new(@file, File::WRONLY|File::APPEND)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "returns a new File when use File::APPEND mode" do
     @fh = File.new(@file, File::APPEND)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "returns a new File when use File::RDONLY|File::APPEND mode" do
     @fh = File.new(@file, File::RDONLY|File::APPEND)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "returns a new File when use File::RDONLY|File::WRONLY mode" do
     @fh = File.new(@file, File::RDONLY|File::WRONLY)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
 
   it "creates a new file when use File::WRONLY|File::TRUNC mode" do
     @fh = File.new(@file, File::WRONLY|File::TRUNC)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "coerces filename using to_str" do
     name = mock("file")
     name.should_receive(:to_str).and_return(@file)
     @fh = File.new(name, "w")
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "coerces filename using #to_path" do
     name = mock("file")
     name.should_receive(:to_path).and_return(@file)
     @fh = File.new(name, "w")
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "raises a TypeError if the first parameter can't be coerced to a string" do
diff --git a/spec/ruby/core/file/open_spec.rb b/spec/ruby/core/file/open_spec.rb
index b6af268..93f1972 100644
--- a/spec/ruby/core/file/open_spec.rb
+++ b/spec/ruby/core/file/open_spec.rb
@@ -63,40 +63,40 @@ describe "File.open" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/open_spec.rb#L63
   it "opens the file (basic case)" do
     @fh = File.open(@file)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "opens the file with unicode characters" do
     @fh = File.open(@unicode_path, "w")
     @fh.should be_kind_of(File)
-    File.exist?(@unicode_path).should == true
+    File.should.exist?(@unicode_path)
   end
 
   it "opens a file when called with a block" do
     File.open(@file) { |fh| }
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "opens with mode string" do
     @fh = File.open(@file, 'w')
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "opens a file with mode string and block" do
     File.open(@file, 'w') { |fh| }
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "opens a file with mode num" do
     @fh = File.open(@file, @flags)
     @fh.should be_kind_of(File)
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "opens a file with mode num and block" do
     File.open(@file, 'w') { |fh| }
-    File.exist?(@file).should == true
+    File.should.exist?(@file)
   end
 
   it "opens a file with (... truncated)

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

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