Add test
This commit is contained in:
parent
ea364210f2
commit
74bb9fb193
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user