Remove temporary files in uninstall and zap specs.
This commit is contained in:
parent
b7135eec49
commit
e0e0233b2d
@ -7,20 +7,33 @@ describe Hbc::Artifact::Uninstall do
|
||||
Hbc::Artifact::Uninstall.new(cask, command: Hbc::FakeSystemCommand)
|
||||
}
|
||||
|
||||
let(:absolute_path) { Pathname.new("#{TEST_TMPDIR}/absolute_path") }
|
||||
let(:path_with_tilde) { Pathname.new("#{TEST_TMPDIR}/path_with_tilde") }
|
||||
let(:glob_path1) { Pathname.new("#{TEST_TMPDIR}/glob_path1") }
|
||||
let(:glob_path2) { Pathname.new("#{TEST_TMPDIR}/glob_path2") }
|
||||
let(:dir) { TEST_TMPDIR }
|
||||
let(:absolute_path) { Pathname.new("#{dir}/absolute_path") }
|
||||
let(:path_with_tilde) { Pathname.new("#{dir}/path_with_tilde") }
|
||||
let(:glob_path1) { Pathname.new("#{dir}/glob_path1") }
|
||||
let(:glob_path2) { Pathname.new("#{dir}/glob_path2") }
|
||||
|
||||
around(:each) do |example|
|
||||
begin
|
||||
ENV["HOME"] = dir
|
||||
|
||||
paths = [
|
||||
absolute_path,
|
||||
path_with_tilde,
|
||||
glob_path1,
|
||||
glob_path2,
|
||||
]
|
||||
|
||||
FileUtils.touch paths
|
||||
|
||||
before(:each) do
|
||||
FileUtils.touch(absolute_path)
|
||||
FileUtils.touch(path_with_tilde)
|
||||
FileUtils.touch(glob_path1)
|
||||
FileUtils.touch(glob_path2)
|
||||
ENV["HOME"] = TEST_TMPDIR
|
||||
shutup do
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
end
|
||||
|
||||
example.run
|
||||
ensure
|
||||
FileUtils.rm_f paths
|
||||
end
|
||||
end
|
||||
|
||||
describe "uninstall_phase" do
|
||||
|
||||
@ -8,20 +8,33 @@ describe Hbc::Artifact::Zap do
|
||||
Hbc::Artifact::Zap.new(cask, command: Hbc::FakeSystemCommand)
|
||||
}
|
||||
|
||||
let(:absolute_path) { Pathname.new("#{TEST_TMPDIR}/absolute_path") }
|
||||
let(:path_with_tilde) { Pathname.new("#{TEST_TMPDIR}/path_with_tilde") }
|
||||
let(:glob_path1) { Pathname.new("#{TEST_TMPDIR}/glob_path1") }
|
||||
let(:glob_path2) { Pathname.new("#{TEST_TMPDIR}/glob_path2") }
|
||||
let(:dir) { TEST_TMPDIR }
|
||||
let(:absolute_path) { Pathname.new("#{dir}/absolute_path") }
|
||||
let(:path_with_tilde) { Pathname.new("#{dir}/path_with_tilde") }
|
||||
let(:glob_path1) { Pathname.new("#{dir}/glob_path1") }
|
||||
let(:glob_path2) { Pathname.new("#{dir}/glob_path2") }
|
||||
|
||||
around(:each) do |example|
|
||||
begin
|
||||
ENV["HOME"] = dir
|
||||
|
||||
paths = [
|
||||
absolute_path,
|
||||
path_with_tilde,
|
||||
glob_path1,
|
||||
glob_path2,
|
||||
]
|
||||
|
||||
FileUtils.touch paths
|
||||
|
||||
before(:each) do
|
||||
FileUtils.touch(absolute_path)
|
||||
FileUtils.touch(path_with_tilde)
|
||||
FileUtils.touch(glob_path1)
|
||||
FileUtils.touch(glob_path2)
|
||||
ENV["HOME"] = TEST_TMPDIR
|
||||
shutup do
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
end
|
||||
|
||||
example.run
|
||||
ensure
|
||||
FileUtils.rm_f paths
|
||||
end
|
||||
end
|
||||
|
||||
describe "#zap_phase" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user