summaryrefslogtreecommitdiff
path: root/spec/ruby/core/file/new_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-09-29 19:13:37 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-09-29 19:13:37 +0200
commit070cbe22b70ec2bec36c7cfc84b726510afa306f (patch)
tree56cee87834c85bd9f358ebee51bab4893fb9952f /spec/ruby/core/file/new_spec.rb
parentd51b4e34fbdbe1a845aa2251b1fa3304de809b32 (diff)
Update to ruby/spec@34e6246
Diffstat (limited to 'spec/ruby/core/file/new_spec.rb')
-rw-r--r--spec/ruby/core/file/new_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/core/file/new_spec.rb b/spec/ruby/core/file/new_spec.rb
index e99f6ba72b..004f78503a 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
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
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
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
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
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