Skip to content
Snippets Groups Projects
Commit 92fe130c authored by Michael Ledin's avatar Michael Ledin
Browse files

Use TEST_TMPDIR in rmdir tests.

parent 5c185eaa
No related branches found
No related tags found
No related merge requests found
......@@ -271,15 +271,23 @@ describe Hbc::Artifact::Uninstall do
context "when using rmdir" do
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-uninstall-rmdir.rb") }
let(:dir_pathname) { Pathname.new("#{TEST_FIXTURE_DIR}/cask/empty_directory") }
let(:empty_directory_path) { Pathname.new("#{TEST_TMPDIR}/empty_directory_path") }
before(:each) do
empty_directory_path.mkdir
end
after(:each) do
empty_directory_path.rmdir
end
it "can uninstall" do
Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -f --], dir_pathname.join(".DS_Store")),
sudo(%w[/bin/rm -f --], empty_directory_path/".DS_Store"),
)
Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rmdir --], dir_pathname),
sudo(%w[/bin/rmdir --], empty_directory_path),
)
subject
......
......@@ -272,15 +272,23 @@ describe Hbc::Artifact::Zap do
context "when using rmdir" do
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-zap-rmdir.rb") }
let(:dir_pathname) { Pathname.new("#{TEST_FIXTURE_DIR}/cask/empty_directory") }
let(:empty_directory_path) { Pathname.new("#{TEST_TMPDIR}/empty_directory_path") }
before(:each) do
empty_directory_path.mkdir
end
after(:each) do
empty_directory_path.rmdir
end
it "can zap" do
Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -f --], dir_pathname.join(".DS_Store")),
sudo(%w[/bin/rm -f --], empty_directory_path/".DS_Store"),
)
Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rmdir --], dir_pathname),
sudo(%w[/bin/rmdir --], empty_directory_path),
)
subject
......
......@@ -17,5 +17,5 @@ cask 'with-installable' do
'impermissible/relative/path',
'/another/impermissible/../relative/path',
],
rmdir: "#{TEST_FIXTURE_DIR}/cask/empty_directory"
rmdir: "#{TEST_TMPDIR}/empty_directory_path"
end
......@@ -7,5 +7,5 @@ cask 'with-uninstall-rmdir' do
pkg 'MyFancyPkg/Fancy.pkg'
uninstall rmdir: "#{TEST_FIXTURE_DIR}/cask/empty_directory"
uninstall rmdir: "#{TEST_TMPDIR}/empty_directory_path"
end
......@@ -7,5 +7,5 @@ cask 'with-zap-rmdir' do
pkg 'MyFancyPkg/Fancy.pkg'
zap rmdir: "#{TEST_FIXTURE_DIR}/cask/empty_directory"
zap rmdir: "#{TEST_TMPDIR}/empty_directory_path"
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment