aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb3
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb4
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/zap.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb2
-rw-r--r--Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb21
-rw-r--r--Library/Homebrew/cask/test/cask/artifact/zap_test.rb4
6 files changed, 28 insertions, 8 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb
index 8b5603064..5a3dc098d 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb
@@ -3,6 +3,9 @@ require "hbc/artifact/uninstall_base"
module Hbc
module Artifact
class Uninstall < UninstallBase
+ def uninstall_phase
+ dispatch_uninstall_directives
+ end
end
end
end
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
index e18e9c311..ce2b1f51a 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
@@ -54,10 +54,6 @@ module Hbc
path_strings - undeletable
end
- def uninstall_phase
- dispatch_uninstall_directives
- end
-
def dispatch_uninstall_directives(expand_tilde: true)
directives_set = @cask.artifacts[stanza]
ohai "Running #{stanza} process for #{@cask}; your password may be necessary"
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/zap.rb b/Library/Homebrew/cask/lib/hbc/artifact/zap.rb
index b31e2ef11..7793e5772 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/zap.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/zap.rb
@@ -3,7 +3,7 @@ require "hbc/artifact/uninstall_base"
module Hbc
module Artifact
class Zap < UninstallBase
- def uninstall_phase
+ def zap_phase
dispatch_uninstall_directives(expand_tilde: true)
end
end
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index 776a3acd2..cafc9d8b9 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -331,7 +331,7 @@ module Hbc
uninstall_artifacts
if Artifact::Zap.me?(@cask)
ohai "Dispatching zap stanza"
- Artifact::Zap.new(@cask, command: @command).uninstall_phase
+ Artifact::Zap.new(@cask, command: @command).zap_phase
else
opoo "No zap stanza present for Cask '#{@cask}'"
end
diff --git a/Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb b/Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb
new file mode 100644
index 000000000..3150b50be
--- /dev/null
+++ b/Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb
@@ -0,0 +1,21 @@
+require "spec_helper"
+
+describe Hbc::Artifact::Zap do
+ let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-installable.rb") }
+
+ let(:zap_artifact) {
+ Hbc::Artifact::Zap.new(cask)
+ }
+
+ before do
+ shutup do
+ InstallHelper.install_without_artifacts(cask)
+ end
+ end
+
+ describe "#uninstall_phase" do
+ subject { zap_artifact }
+
+ it { is_expected.not_to respond_to(:uninstall_phase) }
+ end
+end
diff --git a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb
index ea546728b..37a65f863 100644
--- a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb
+++ b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb
@@ -14,10 +14,10 @@ describe Hbc::Artifact::Zap do
end
end
- describe "uninstall_phase" do
+ describe "#zap_phase" do
subject {
shutup do
- zap_artifact.uninstall_phase
+ zap_artifact.zap_phase
end
}