diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-05-03 12:28:29 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-05-03 12:28:29 +0200 |
commit | 5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 (patch) | |
tree | e1694f5a4a5558884b1b8f3890b186793e5e982f /spec/ruby/core/file | |
parent | f646d20aaeb8f02bcd3d0c5c3f5a372da654502a (diff) | |
download | ruby-5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39.tar.gz |
Update to ruby/spec@032ee74
Diffstat (limited to 'spec/ruby/core/file')
-rw-r--r-- | spec/ruby/core/file/expand_path_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/file/lchmod_spec.rb | 12 | ||||
-rw-r--r-- | spec/ruby/core/file/lstat_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/open_spec.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/owned_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/pipe_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/stat_spec.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/file/truncate_spec.rb | 6 |
8 files changed, 26 insertions, 26 deletions
diff --git a/spec/ruby/core/file/expand_path_spec.rb b/spec/ruby/core/file/expand_path_spec.rb index 88078645ab..c31f885b92 100644 --- a/spec/ruby/core/file/expand_path_spec.rb +++ b/spec/ruby/core/file/expand_path_spec.rb @@ -203,9 +203,9 @@ platform_is_not :windows do it "does not return a frozen string" do home = "/rubyspec_home" - File.expand_path('~').frozen?.should == false - File.expand_path('~', '/tmp/gumby/ddd').frozen?.should == false - File.expand_path('~/a', '/tmp/gumby/ddd').frozen?.should == false + File.expand_path('~').should_not.frozen? + File.expand_path('~', '/tmp/gumby/ddd').should_not.frozen? + File.expand_path('~/a', '/tmp/gumby/ddd').should_not.frozen? end end diff --git a/spec/ruby/core/file/lchmod_spec.rb b/spec/ruby/core/file/lchmod_spec.rb index bab362980a..4abe42526d 100644 --- a/spec/ruby/core/file/lchmod_spec.rb +++ b/spec/ruby/core/file/lchmod_spec.rb @@ -20,13 +20,13 @@ describe "File.lchmod" do File.chmod(0222, @lname).should == 1 File.lchmod(0755, @lname).should == 1 - File.lstat(@lname).executable?.should == true - File.lstat(@lname).readable?.should == true - File.lstat(@lname).writable?.should == true + File.lstat(@lname).should.executable? + File.lstat(@lname).should.readable? + File.lstat(@lname).should.writable? - File.stat(@lname).executable?.should == false - File.stat(@lname).readable?.should == false - File.stat(@lname).writable?.should == true + File.stat(@lname).should_not.executable? + File.stat(@lname).should_not.readable? + File.stat(@lname).should.writable? end end diff --git a/spec/ruby/core/file/lstat_spec.rb b/spec/ruby/core/file/lstat_spec.rb index 918ed02163..a5ea9d15a5 100644 --- a/spec/ruby/core/file/lstat_spec.rb +++ b/spec/ruby/core/file/lstat_spec.rb @@ -22,8 +22,8 @@ describe "File.lstat" do it "returns a File::Stat object with symlink properties for a symlink" do st = File.lstat(@link) - st.symlink?.should == true - st.file?.should == false + st.should.symlink? + st.should_not.file? end end end diff --git a/spec/ruby/core/file/open_spec.rb b/spec/ruby/core/file/open_spec.rb index 7ceeb47dd8..8faa31173e 100644 --- a/spec/ruby/core/file/open_spec.rb +++ b/spec/ruby/core/file/open_spec.rb @@ -28,7 +28,7 @@ describe "File.open" do describe "with a block" do it "does not raise error when file is closed inside the block" do @fh = File.open(@file) { |fh| fh.close; fh } - @fh.closed?.should == true + @fh.should.closed? end it "invokes close on an opened file when exiting the block" do @@ -485,7 +485,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "w+") do |f| f.pos.should == 0 - f.eof?.should == true + f.should.eof? end File.size(@file).should == 0 end @@ -495,7 +495,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "rb+") do |f| f.pos.should == 0 - f.eof?.should == false + f.should_not.eof? end end @@ -504,7 +504,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "wb+") do |f| f.pos.should == 0 - f.eof?.should == true + f.should.eof? end File.size(@file).should == 0 end diff --git a/spec/ruby/core/file/stat/owned_spec.rb b/spec/ruby/core/file/stat/owned_spec.rb index fbd473c4d7..a23ad850c5 100644 --- a/spec/ruby/core/file/stat/owned_spec.rb +++ b/spec/ruby/core/file/stat/owned_spec.rb @@ -18,7 +18,7 @@ describe "File::Stat#owned?" do it "returns true if the file is owned by the user" do st = File.stat(@file) - st.owned?.should == true + st.should.owned? end platform_is_not :windows, :android do @@ -26,7 +26,7 @@ describe "File::Stat#owned?" do it "returns false if the file is not owned by the user" do system_file = '/etc/passwd' st = File.stat(system_file) - st.owned?.should == false + st.should_not.owned? end end end diff --git a/spec/ruby/core/file/stat/pipe_spec.rb b/spec/ruby/core/file/stat/pipe_spec.rb index 7abb6c742a..692dfbf42a 100644 --- a/spec/ruby/core/file/stat/pipe_spec.rb +++ b/spec/ruby/core/file/stat/pipe_spec.rb @@ -12,7 +12,7 @@ describe "File::Stat#pipe?" do touch(filename) st = File.stat(filename) - st.pipe?.should == false + st.should_not.pipe? rm_r filename end @@ -23,7 +23,7 @@ describe "File::Stat#pipe?" do File.mkfifo(filename) st = File.stat(filename) - st.pipe?.should == true + st.should.pipe? rm_r filename end diff --git a/spec/ruby/core/file/stat_spec.rb b/spec/ruby/core/file/stat_spec.rb index 275eae36d5..6365500057 100644 --- a/spec/ruby/core/file/stat_spec.rb +++ b/spec/ruby/core/file/stat_spec.rb @@ -23,8 +23,8 @@ platform_is_not :windows do st = f.stat - st.file?.should == true - st.zero?.should == false + st.should.file? + st.should_not.zero? st.size.should == 8 st.size?.should == 8 st.blksize.should >= 0 @@ -38,8 +38,8 @@ platform_is_not :windows do File.symlink(@file, @link) st = File.stat(@link) - st.file?.should == true - st.symlink?.should == false + st.should.file? + st.should_not.symlink? end it "returns an error when given missing non-ASCII path" do diff --git a/spec/ruby/core/file/truncate_spec.rb b/spec/ruby/core/file/truncate_spec.rb index 43b86b7382..b4a2e3e577 100644 --- a/spec/ruby/core/file/truncate_spec.rb +++ b/spec/ruby/core/file/truncate_spec.rb @@ -18,7 +18,7 @@ describe "File.truncate" do File.open(@name, "r") do |f| f.read(99).should == "12345" - f.eof?.should == true + f.should.eof? end end @@ -120,7 +120,7 @@ describe "File#truncate" do File.size(@name).should == 5 File.open(@name, "r") do |f| f.read(99).should == "12345" - f.eof?.should == true + f.should.eof? end end @@ -161,7 +161,7 @@ describe "File#truncate" do it "raises an IOError if file is closed" do @file.close - @file.closed?.should == true + @file.should.closed? -> { @file.truncate(42) }.should raise_error(IOError) end |