Install builder: remove target file before copying to avoid errors due to overwriting read-only files - close #123

This commit is contained in:
josh committed 2021-02-23 15:20:59 -05:00
1 parent b970490de2
commit b92360d4e2
3 files changed
+20

No files matched your search

+16
View File
@@ -1002,6 +1002,22 @@ EOF
expect(lines(result.stdout)).to eq ["Install inst.exe"]
end
it "overwrites a read-only file" do
test_dir("build_dir")
FileUtils.chmod("a=r", "install.rb")
result = run_test(rsconsfile: "install_read_only.rb")
expect(result.stderr).to eq ""
expect(lines(result.stdout)).to eq ["Install dest"]
FileUtils.rm_f("install.rb")
File.binwrite("install.rb", "hi")
FileUtils.chmod("a=r", "install.rb")
result = run_test(rsconsfile: "install_read_only.rb")
expect(result.stderr).to eq ""
expect(lines(result.stdout)).to eq ["Install dest"]
end
it "operates the same as a Copy builder" do
test_dir("build_dir")