diff options
author | Benoit Daloze <[email protected]> | 2022-07-27 17:18:25 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2022-07-27 17:18:25 +0200 |
commit | 6582df26dcdef5dab01242b4d97d9b242e959860 (patch) | |
tree | 99824a5c370ef27acd12905b67304870f1af9561 /spec/ruby/shared/file/readable.rb | |
parent | 44f42413e6c3c2b487a03b53bf6cacbb83ac285b (diff) |
Update to ruby/spec@cbfaf51
Diffstat (limited to 'spec/ruby/shared/file/readable.rb')
-rw-r--r-- | spec/ruby/shared/file/readable.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/shared/file/readable.rb b/spec/ruby/shared/file/readable.rb index eb2ca06812..7b45e23e36 100644 --- a/spec/ruby/shared/file/readable.rb +++ b/spec/ruby/shared/file/readable.rb @@ -24,6 +24,22 @@ describe :file_readable, shared: true do it "accepts an object that has a #to_path method" do @object.send(@method, mock_to_path(@file2)).should == true end + + platform_is_not :windows do + as_superuser do + context "when run by a superuser" do + it "returns true unconditionally" do + file = tmp('temp.txt') + touch file + + File.chmod(0333, file) + @object.send(@method, file).should == true + + rm_r file + end + end + end + end end describe :file_readable_missing, shared: true do |