diff options
| author | Michael Ledin | 2017-02-19 07:57:41 +0300 |
|---|---|---|
| committer | Michael Ledin | 2017-02-19 08:02:00 +0300 |
| commit | 5c185eaa4355810ccc6617cb078ee67d4fa0777c (patch) | |
| tree | 9dcda2d8c1fa0d7234eb973fed3523b553d0e773 /Library/Homebrew/cask/spec | |
| parent | cd2dd2a5444bc6ba67f20fcc0d0d113d8005fecb (diff) | |
| download | brew-5c185eaa4355810ccc6617cb078ee67d4fa0777c.tar.bz2 | |
Expand glob patterns.
Diffstat (limited to 'Library/Homebrew/cask/spec')
| -rw-r--r-- | Library/Homebrew/cask/spec/cask/artifact/uninstall_spec.rb | 22 | ||||
| -rw-r--r-- | Library/Homebrew/cask/spec/cask/artifact/zap_spec.rb | 22 |
2 files changed, 36 insertions, 8 deletions
diff --git a/Library/Homebrew/cask/spec/cask/artifact/uninstall_spec.rb b/Library/Homebrew/cask/spec/cask/artifact/uninstall_spec.rb index a38ed903e..05af462dc 100644 --- a/Library/Homebrew/cask/spec/cask/artifact/uninstall_spec.rb +++ b/Library/Homebrew/cask/spec/cask/artifact/uninstall_spec.rb @@ -7,7 +7,17 @@ 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") } + 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 @@ -233,8 +243,10 @@ describe Hbc::Artifact::Uninstall do it "can uninstall" do Hbc::FakeSystemCommand.expects_command( sudo(%w[/bin/rm -rf --], - Pathname.new("/permissible/absolute/path"), - Pathname.new("~/permissible/path/with/tilde").expand_path), + absolute_path, + path_with_tilde, + glob_path1, + glob_path2), ) subject @@ -247,8 +259,10 @@ describe Hbc::Artifact::Uninstall do it "can uninstall" do Hbc::FakeSystemCommand.expects_command( sudo(%w[/bin/rm -rf --], - Pathname.new("/permissible/absolute/path"), - Pathname.new("~/permissible/path/with/tilde").expand_path), + absolute_path, + path_with_tilde, + glob_path1, + glob_path2), ) subject diff --git a/Library/Homebrew/cask/spec/cask/artifact/zap_spec.rb b/Library/Homebrew/cask/spec/cask/artifact/zap_spec.rb index 50e132bfa..b87b6ce1c 100644 --- a/Library/Homebrew/cask/spec/cask/artifact/zap_spec.rb +++ b/Library/Homebrew/cask/spec/cask/artifact/zap_spec.rb @@ -8,7 +8,17 @@ 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") } + 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 @@ -234,8 +244,10 @@ describe Hbc::Artifact::Zap do it "can zap" do Hbc::FakeSystemCommand.expects_command( sudo(%w[/bin/rm -rf --], - Pathname.new("/permissible/absolute/path"), - Pathname.new("~/permissible/path/with/tilde").expand_path), + absolute_path, + path_with_tilde, + glob_path1, + glob_path2), ) subject @@ -248,8 +260,10 @@ describe Hbc::Artifact::Zap do it "can zap" do Hbc::FakeSystemCommand.expects_command( sudo(%w[/bin/rm -rf --], - Pathname.new("/permissible/absolute/path"), - Pathname.new("~/permissible/path/with/tilde").expand_path), + absolute_path, + path_with_tilde, + glob_path1, + glob_path2), ) subject |
