This commit is contained in:
Thierry Moisan 2024-07-13 16:07:48 -04:00 committed by Rylan Polster
parent ea364210f2
commit 74bb9fb193
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64

View File

@ -57,4 +57,18 @@ RSpec.describe Sandbox, :needs_macos do
.and output(a_string_matching(/foo/).and(matching(/bar/).and(not_matching(/Python/)))).to_stdout .and output(a_string_matching(/foo/).and(matching(/bar/).and(not_matching(/Python/)))).to_stdout
end end
end end
describe "#disallow chmod on some directory" do
it "formula does a chmod to opt" do
expect { sandbox.exec "chmod", "ug-w", HOMEBREW_PREFIX}.to raise_error(ErrorDuringExecution)
end
it "allows chmod on a path allowed to write" do
mktmpdir do |path|
FileUtils.touch path/"foo"
sandbox.allow_write_path(path)
expect { sandbox.exec "chmod", "ug-w", path/"foo"}.not_to raise_error(ErrorDuringExecution)
end
end
end
end end