Use TEST_TMPDIR in rmdir tests.
This commit is contained in:
parent
5c185eaa43
commit
92fe130cbb
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user