1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

source directory may not be writable

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-05-22 14:25:56 +00:00
parent cbedbaf9d9
commit 35695788d1
2 changed files with 19 additions and 6 deletions

View file

@ -40,8 +40,10 @@ describe :dir_delete, shared: true do
end end
it "raises an Errno::ENOTDIR when trying to remove a non-directory" do it "raises an Errno::ENOTDIR when trying to remove a non-directory" do
file = DirSpecs.mock_rmdir("nonempty/regular")
open(file, "w") {}
lambda do lambda do
Dir.send @method, __FILE__ Dir.send @method, file
end.should raise_error(Errno::ENOTDIR) end.should raise_error(Errno::ENOTDIR)
end end

View file

@ -43,12 +43,23 @@ describe "Kernel#test" do
Kernel.test(?R, @file).should be_true Kernel.test(?R, @file).should be_true
end end
context "writable test" do
before do
@tmp_file = tmp("file.kernel.test")
open(@tmp_file, "w") {}
end
after do
rm_r @tmp_file
end
it "returns true when passed ?w if the argument is readable by the effective uid" do it "returns true when passed ?w if the argument is readable by the effective uid" do
Kernel.test(?w, @file).should be_true Kernel.test(?w, @tmp_file).should be_true
end end
it "returns true when passed ?W if the argument is readable by the real uid" do it "returns true when passed ?W if the argument is readable by the real uid" do
Kernel.test(?W, @file).should be_true Kernel.test(?W, @tmp_file).should be_true
end
end end
context "time commands" do context "time commands" do