diff --git a/Library/Homebrew/cask/artifact.rb b/Library/Homebrew/cask/artifact.rb index f50249116a..1d89d6e9d7 100644 --- a/Library/Homebrew/cask/artifact.rb +++ b/Library/Homebrew/cask/artifact.rb @@ -22,7 +22,7 @@ require "cask/artifact/suite" require "cask/artifact/uninstall" require "cask/artifact/zap" -module Hbc +module Cask module Artifact end end diff --git a/Library/Homebrew/cask/artifact/abstract_artifact.rb b/Library/Homebrew/cask/artifact/abstract_artifact.rb index 80d925c879..f8ceb22001 100644 --- a/Library/Homebrew/cask/artifact/abstract_artifact.rb +++ b/Library/Homebrew/cask/artifact/abstract_artifact.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Artifact class AbstractArtifact include Comparable diff --git a/Library/Homebrew/cask/artifact/abstract_flight_block.rb b/Library/Homebrew/cask/artifact/abstract_flight_block.rb index ae4d1451ca..3da3ba391d 100644 --- a/Library/Homebrew/cask/artifact/abstract_flight_block.rb +++ b/Library/Homebrew/cask/artifact/abstract_flight_block.rb @@ -1,6 +1,6 @@ require "cask/artifact/abstract_artifact" -module Hbc +module Cask module Artifact class AbstractFlightBlock < AbstractArtifact def self.dsl_key diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 597cbc0caf..cabf5306fb 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -2,7 +2,7 @@ require "timeout" require "cask/artifact/abstract_artifact" -module Hbc +module Cask module Artifact class AbstractUninstall < AbstractArtifact ORDERED_DIRECTIVES = [ @@ -218,7 +218,7 @@ module Hbc def uninstall_pkgutil(*pkgs, command: nil, **_) ohai "Uninstalling packages:" pkgs.each do |regex| - ::Hbc::Pkg.all_matching(regex, command).each do |pkg| + ::Cask::Pkg.all_matching(regex, command).each do |pkg| puts pkg.package_id pkg.uninstall end diff --git a/Library/Homebrew/cask/artifact/app.rb b/Library/Homebrew/cask/artifact/app.rb index eb189fea4e..a1c92120e9 100644 --- a/Library/Homebrew/cask/artifact/app.rb +++ b/Library/Homebrew/cask/artifact/app.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class App < Moved end diff --git a/Library/Homebrew/cask/artifact/artifact.rb b/Library/Homebrew/cask/artifact/artifact.rb index 51f8386819..28907292d5 100644 --- a/Library/Homebrew/cask/artifact/artifact.rb +++ b/Library/Homebrew/cask/artifact/artifact.rb @@ -3,7 +3,7 @@ require "cask/artifact/moved" require "extend/hash_validator" using HashValidator -module Hbc +module Cask module Artifact class Artifact < Moved def self.english_name diff --git a/Library/Homebrew/cask/artifact/audio_unit_plugin.rb b/Library/Homebrew/cask/artifact/audio_unit_plugin.rb index 79fac1b3a5..84c1a694ab 100644 --- a/Library/Homebrew/cask/artifact/audio_unit_plugin.rb +++ b/Library/Homebrew/cask/artifact/audio_unit_plugin.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class AudioUnitPlugin < Moved end diff --git a/Library/Homebrew/cask/artifact/binary.rb b/Library/Homebrew/cask/artifact/binary.rb index ad059f7770..353b094e45 100644 --- a/Library/Homebrew/cask/artifact/binary.rb +++ b/Library/Homebrew/cask/artifact/binary.rb @@ -1,6 +1,6 @@ require "cask/artifact/symlinked" -module Hbc +module Cask module Artifact class Binary < Symlinked def link(command: nil, **options) diff --git a/Library/Homebrew/cask/artifact/colorpicker.rb b/Library/Homebrew/cask/artifact/colorpicker.rb index 1e1adbcea2..28a9b7db06 100644 --- a/Library/Homebrew/cask/artifact/colorpicker.rb +++ b/Library/Homebrew/cask/artifact/colorpicker.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Colorpicker < Moved end diff --git a/Library/Homebrew/cask/artifact/dictionary.rb b/Library/Homebrew/cask/artifact/dictionary.rb index 4ac499738e..129fab095f 100644 --- a/Library/Homebrew/cask/artifact/dictionary.rb +++ b/Library/Homebrew/cask/artifact/dictionary.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Dictionary < Moved end diff --git a/Library/Homebrew/cask/artifact/font.rb b/Library/Homebrew/cask/artifact/font.rb index 81e6f436be..ebf158c223 100644 --- a/Library/Homebrew/cask/artifact/font.rb +++ b/Library/Homebrew/cask/artifact/font.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Font < Moved end diff --git a/Library/Homebrew/cask/artifact/input_method.rb b/Library/Homebrew/cask/artifact/input_method.rb index 444b8238d3..3637e3ca2f 100644 --- a/Library/Homebrew/cask/artifact/input_method.rb +++ b/Library/Homebrew/cask/artifact/input_method.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class InputMethod < Moved end diff --git a/Library/Homebrew/cask/artifact/installer.rb b/Library/Homebrew/cask/artifact/installer.rb index 8c1e72295b..05811ec122 100644 --- a/Library/Homebrew/cask/artifact/installer.rb +++ b/Library/Homebrew/cask/artifact/installer.rb @@ -3,7 +3,7 @@ require "cask/artifact/abstract_artifact" require "extend/hash_validator" using HashValidator -module Hbc +module Cask module Artifact class Installer < AbstractArtifact VALID_KEYS = Set.new [ diff --git a/Library/Homebrew/cask/artifact/internet_plugin.rb b/Library/Homebrew/cask/artifact/internet_plugin.rb index 2f232874cd..da7404789b 100644 --- a/Library/Homebrew/cask/artifact/internet_plugin.rb +++ b/Library/Homebrew/cask/artifact/internet_plugin.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class InternetPlugin < Moved end diff --git a/Library/Homebrew/cask/artifact/moved.rb b/Library/Homebrew/cask/artifact/moved.rb index a3730bfc55..7840e95c4b 100644 --- a/Library/Homebrew/cask/artifact/moved.rb +++ b/Library/Homebrew/cask/artifact/moved.rb @@ -1,6 +1,6 @@ require "cask/artifact/relocated" -module Hbc +module Cask module Artifact class Moved < Relocated def self.english_description diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 21f9280c46..45e3bba128 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -5,7 +5,7 @@ require "cask/artifact/abstract_artifact" require "extend/hash_validator" using HashValidator -module Hbc +module Cask module Artifact class Pkg < AbstractArtifact attr_reader :pkg_relative_path diff --git a/Library/Homebrew/cask/artifact/postflight_block.rb b/Library/Homebrew/cask/artifact/postflight_block.rb index 9233343561..50c1e5d7fa 100644 --- a/Library/Homebrew/cask/artifact/postflight_block.rb +++ b/Library/Homebrew/cask/artifact/postflight_block.rb @@ -1,6 +1,6 @@ require "cask/artifact/abstract_flight_block" -module Hbc +module Cask module Artifact class PostflightBlock < AbstractFlightBlock end diff --git a/Library/Homebrew/cask/artifact/preflight_block.rb b/Library/Homebrew/cask/artifact/preflight_block.rb index 80356bdd44..3984eab8a0 100644 --- a/Library/Homebrew/cask/artifact/preflight_block.rb +++ b/Library/Homebrew/cask/artifact/preflight_block.rb @@ -1,6 +1,6 @@ require "cask/artifact/abstract_flight_block" -module Hbc +module Cask module Artifact class PreflightBlock < AbstractFlightBlock end diff --git a/Library/Homebrew/cask/artifact/prefpane.rb b/Library/Homebrew/cask/artifact/prefpane.rb index ca06a0407c..7221a1a803 100644 --- a/Library/Homebrew/cask/artifact/prefpane.rb +++ b/Library/Homebrew/cask/artifact/prefpane.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Prefpane < Moved def self.english_name diff --git a/Library/Homebrew/cask/artifact/qlplugin.rb b/Library/Homebrew/cask/artifact/qlplugin.rb index 0a5766e4b8..4317b5f3b8 100644 --- a/Library/Homebrew/cask/artifact/qlplugin.rb +++ b/Library/Homebrew/cask/artifact/qlplugin.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Qlplugin < Moved def self.english_name diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index ae3be9eebb..81006cd533 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -3,7 +3,7 @@ require "cask/artifact/abstract_artifact" require "extend/hash_validator" using HashValidator -module Hbc +module Cask module Artifact class Relocated < AbstractArtifact def self.from_args(cask, *args) diff --git a/Library/Homebrew/cask/artifact/screen_saver.rb b/Library/Homebrew/cask/artifact/screen_saver.rb index 5526f6dcd1..2a7746e9ba 100644 --- a/Library/Homebrew/cask/artifact/screen_saver.rb +++ b/Library/Homebrew/cask/artifact/screen_saver.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class ScreenSaver < Moved end diff --git a/Library/Homebrew/cask/artifact/service.rb b/Library/Homebrew/cask/artifact/service.rb index b92c99efdd..87c28928f3 100644 --- a/Library/Homebrew/cask/artifact/service.rb +++ b/Library/Homebrew/cask/artifact/service.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Service < Moved end diff --git a/Library/Homebrew/cask/artifact/stage_only.rb b/Library/Homebrew/cask/artifact/stage_only.rb index 1da1ceff6e..3d45dc057f 100644 --- a/Library/Homebrew/cask/artifact/stage_only.rb +++ b/Library/Homebrew/cask/artifact/stage_only.rb @@ -1,6 +1,6 @@ require "cask/artifact/abstract_artifact" -module Hbc +module Cask module Artifact class StageOnly < AbstractArtifact def self.from_args(cask, *args) diff --git a/Library/Homebrew/cask/artifact/suite.rb b/Library/Homebrew/cask/artifact/suite.rb index b8a6011d77..7a02898263 100644 --- a/Library/Homebrew/cask/artifact/suite.rb +++ b/Library/Homebrew/cask/artifact/suite.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Suite < Moved def self.english_name diff --git a/Library/Homebrew/cask/artifact/symlinked.rb b/Library/Homebrew/cask/artifact/symlinked.rb index 690fb76487..281a8e6e2c 100644 --- a/Library/Homebrew/cask/artifact/symlinked.rb +++ b/Library/Homebrew/cask/artifact/symlinked.rb @@ -1,6 +1,6 @@ require "cask/artifact/relocated" -module Hbc +module Cask module Artifact class Symlinked < Relocated def self.link_type_english_name diff --git a/Library/Homebrew/cask/artifact/uninstall.rb b/Library/Homebrew/cask/artifact/uninstall.rb index 41e8fd9d5b..6e2b12098c 100644 --- a/Library/Homebrew/cask/artifact/uninstall.rb +++ b/Library/Homebrew/cask/artifact/uninstall.rb @@ -1,6 +1,6 @@ require "cask/artifact/abstract_uninstall" -module Hbc +module Cask module Artifact class Uninstall < AbstractUninstall def uninstall_phase(**options) diff --git a/Library/Homebrew/cask/artifact/vst3_plugin.rb b/Library/Homebrew/cask/artifact/vst3_plugin.rb index 96ad48fe51..f067c014c2 100644 --- a/Library/Homebrew/cask/artifact/vst3_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst3_plugin.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class Vst3Plugin < Moved end diff --git a/Library/Homebrew/cask/artifact/vst_plugin.rb b/Library/Homebrew/cask/artifact/vst_plugin.rb index e8e891e34a..661e16de7f 100644 --- a/Library/Homebrew/cask/artifact/vst_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst_plugin.rb @@ -1,6 +1,6 @@ require "cask/artifact/moved" -module Hbc +module Cask module Artifact class VstPlugin < Moved end diff --git a/Library/Homebrew/cask/artifact/zap.rb b/Library/Homebrew/cask/artifact/zap.rb index 057f5dd6cf..168797468f 100644 --- a/Library/Homebrew/cask/artifact/zap.rb +++ b/Library/Homebrew/cask/artifact/zap.rb @@ -1,6 +1,6 @@ require "cask/artifact/abstract_uninstall" -module Hbc +module Cask module Artifact class Zap < AbstractUninstall def zap_phase(**options) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 8a49e5aab2..e0a2cb0a45 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -3,7 +3,7 @@ require "cask/download" require "digest" require "utils/git" -module Hbc +module Cask class Audit include Checkable diff --git a/Library/Homebrew/cask/auditor.rb b/Library/Homebrew/cask/auditor.rb index 014accd3d4..c80aa39ce5 100644 --- a/Library/Homebrew/cask/auditor.rb +++ b/Library/Homebrew/cask/auditor.rb @@ -1,6 +1,6 @@ require "cask/download" -module Hbc +module Cask class Auditor def self.audit(cask, audit_download: false, check_token_conflicts: false, quarantine: true, commit_range: nil) new(cask, audit_download, check_token_conflicts, quarantine, commit_range).audit diff --git a/Library/Homebrew/cask/cache.rb b/Library/Homebrew/cask/cache.rb index 69bcefb68b..525d8c2b63 100644 --- a/Library/Homebrew/cask/cache.rb +++ b/Library/Homebrew/cask/cache.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Cache module_function diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index c951dbde0e..cdd1a52a25 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -4,7 +4,7 @@ require "cask/dsl" require "cask/metadata" require "searchable" -module Hbc +module Cask class Cask extend Enumerable extend Forwardable diff --git a/Library/Homebrew/cask/cask_dependencies.rb b/Library/Homebrew/cask/cask_dependencies.rb index 7e838d1457..3839ca6670 100644 --- a/Library/Homebrew/cask/cask_dependencies.rb +++ b/Library/Homebrew/cask/cask_dependencies.rb @@ -2,7 +2,7 @@ require "delegate" require "cask/topological_hash" -module Hbc +module Cask class CaskDependencies < DelegateClass(Array) attr_reader :cask, :graph diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index c64c60e3fc..68f78e4bd9 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -1,7 +1,7 @@ require "cask/cask" require "uri" -module Hbc +module Cask module CaskLoader class FromContentLoader attr_reader :content diff --git a/Library/Homebrew/cask/caskroom.rb b/Library/Homebrew/cask/caskroom.rb index cd3e1d52b9..486456b677 100644 --- a/Library/Homebrew/cask/caskroom.rb +++ b/Library/Homebrew/cask/caskroom.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Caskroom module_function diff --git a/Library/Homebrew/cask/checkable.rb b/Library/Homebrew/cask/checkable.rb index 604dd3f89c..bac03f5fb9 100644 --- a/Library/Homebrew/cask/checkable.rb +++ b/Library/Homebrew/cask/checkable.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Checkable def errors @errors ||= [] diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 6ec7a83212..4e5ee13b2f 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -29,7 +29,7 @@ require "cask/cmd/abstract_internal_command" require "cask/cmd/internal_help" require "cask/cmd/internal_stanza" -module Hbc +module Cask class Cmd ALIASES = { "ls" => "list", diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index 60ada8e7eb..07f118e30f 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -1,7 +1,7 @@ require_relative "options" require "search" -module Hbc +module Cask class Cmd class AbstractCommand include Options diff --git a/Library/Homebrew/cask/cmd/abstract_internal_command.rb b/Library/Homebrew/cask/cmd/abstract_internal_command.rb index cc0032fc7d..52c47f5cb2 100644 --- a/Library/Homebrew/cask/cmd/abstract_internal_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_internal_command.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class AbstractInternalCommand < AbstractCommand def self.command_name diff --git a/Library/Homebrew/cask/cmd/audit.rb b/Library/Homebrew/cask/cmd/audit.rb index 0d8ce73783..02f41de920 100644 --- a/Library/Homebrew/cask/cmd/audit.rb +++ b/Library/Homebrew/cask/cmd/audit.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Audit < AbstractCommand option "--download", :download, false diff --git a/Library/Homebrew/cask/cmd/cat.rb b/Library/Homebrew/cask/cmd/cat.rb index 67d6dc280d..558dadc216 100644 --- a/Library/Homebrew/cask/cmd/cat.rb +++ b/Library/Homebrew/cask/cmd/cat.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Cat < AbstractCommand def initialize(*) diff --git a/Library/Homebrew/cask/cmd/create.rb b/Library/Homebrew/cask/cmd/create.rb index 1de142edfc..b9fcba49f3 100644 --- a/Library/Homebrew/cask/cmd/create.rb +++ b/Library/Homebrew/cask/cmd/create.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Create < AbstractCommand def initialize(*) diff --git a/Library/Homebrew/cask/cmd/doctor.rb b/Library/Homebrew/cask/cmd/doctor.rb index 69a931b285..1f21a2a17a 100644 --- a/Library/Homebrew/cask/cmd/doctor.rb +++ b/Library/Homebrew/cask/cmd/doctor.rb @@ -1,7 +1,7 @@ require "system_config" require "cask/checkable" -module Hbc +module Cask class Cmd class Doctor < AbstractCommand include Checkable diff --git a/Library/Homebrew/cask/cmd/edit.rb b/Library/Homebrew/cask/cmd/edit.rb index 0a22dadc69..9870185c17 100644 --- a/Library/Homebrew/cask/cmd/edit.rb +++ b/Library/Homebrew/cask/cmd/edit.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Edit < AbstractCommand def initialize(*) diff --git a/Library/Homebrew/cask/cmd/fetch.rb b/Library/Homebrew/cask/cmd/fetch.rb index 5131b6761b..ac7f9c6365 100644 --- a/Library/Homebrew/cask/cmd/fetch.rb +++ b/Library/Homebrew/cask/cmd/fetch.rb @@ -1,6 +1,6 @@ require "cask/download" -module Hbc +module Cask class Cmd class Fetch < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cask/cmd/home.rb b/Library/Homebrew/cask/cmd/home.rb index 0d36b821ec..4c4f4bc30c 100644 --- a/Library/Homebrew/cask/cmd/home.rb +++ b/Library/Homebrew/cask/cmd/home.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Home < AbstractCommand def run diff --git a/Library/Homebrew/cask/cmd/info.rb b/Library/Homebrew/cask/cmd/info.rb index afef9da708..ff9d5c75c4 100644 --- a/Library/Homebrew/cask/cmd/info.rb +++ b/Library/Homebrew/cask/cmd/info.rb @@ -1,6 +1,6 @@ require "json" -module Hbc +module Cask class Cmd class Info < AbstractCommand option "--json=VERSION", :json diff --git a/Library/Homebrew/cask/cmd/install.rb b/Library/Homebrew/cask/cmd/install.rb index 4a6c925ab6..fd9eda548f 100644 --- a/Library/Homebrew/cask/cmd/install.rb +++ b/Library/Homebrew/cask/cmd/install.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Install < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cask/cmd/internal_help.rb b/Library/Homebrew/cask/cmd/internal_help.rb index ccde3f0d02..e680d46ea3 100644 --- a/Library/Homebrew/cask/cmd/internal_help.rb +++ b/Library/Homebrew/cask/cmd/internal_help.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class InternalHelp < AbstractInternalCommand def initialize(*) diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index fbb321110b..97387a31e0 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class InternalStanza < AbstractInternalCommand # Syntax diff --git a/Library/Homebrew/cask/cmd/list.rb b/Library/Homebrew/cask/cmd/list.rb index ab09207392..d836f51ead 100644 --- a/Library/Homebrew/cask/cmd/list.rb +++ b/Library/Homebrew/cask/cmd/list.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class List < AbstractCommand option "-1", :one, false diff --git a/Library/Homebrew/cask/cmd/options.rb b/Library/Homebrew/cask/cmd/options.rb index 8ccd0a89eb..9acdfbf8cd 100644 --- a/Library/Homebrew/cask/cmd/options.rb +++ b/Library/Homebrew/cask/cmd/options.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd module Options def self.included(klass) diff --git a/Library/Homebrew/cask/cmd/outdated.rb b/Library/Homebrew/cask/cmd/outdated.rb index f61f4ade52..519758317b 100644 --- a/Library/Homebrew/cask/cmd/outdated.rb +++ b/Library/Homebrew/cask/cmd/outdated.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Outdated < AbstractCommand option "--greedy", :greedy, false diff --git a/Library/Homebrew/cask/cmd/reinstall.rb b/Library/Homebrew/cask/cmd/reinstall.rb index f5c3af8850..87a964189d 100644 --- a/Library/Homebrew/cask/cmd/reinstall.rb +++ b/Library/Homebrew/cask/cmd/reinstall.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Reinstall < Install def run diff --git a/Library/Homebrew/cask/cmd/style.rb b/Library/Homebrew/cask/cmd/style.rb index 2aea7e2a1a..95ac2b088c 100644 --- a/Library/Homebrew/cask/cmd/style.rb +++ b/Library/Homebrew/cask/cmd/style.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Style < AbstractCommand def self.help diff --git a/Library/Homebrew/cask/cmd/uninstall.rb b/Library/Homebrew/cask/cmd/uninstall.rb index 4a06824ea0..e2fb0fe324 100644 --- a/Library/Homebrew/cask/cmd/uninstall.rb +++ b/Library/Homebrew/cask/cmd/uninstall.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Uninstall < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 7218a8d199..a42a882ff4 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Upgrade < AbstractCommand option "--greedy", :greedy, false diff --git a/Library/Homebrew/cask/cmd/zap.rb b/Library/Homebrew/cask/cmd/zap.rb index 8ce8df0a1a..8436a1ff7b 100644 --- a/Library/Homebrew/cask/cmd/zap.rb +++ b/Library/Homebrew/cask/cmd/zap.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Cmd class Zap < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cask/config.rb b/Library/Homebrew/cask/config.rb index 43408d53d3..07ffee2ead 100644 --- a/Library/Homebrew/cask/config.rb +++ b/Library/Homebrew/cask/config.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Config def self.global @global ||= new diff --git a/Library/Homebrew/cask/download.rb b/Library/Homebrew/cask/download.rb index 1446d40dae..5b7a63d9bc 100644 --- a/Library/Homebrew/cask/download.rb +++ b/Library/Homebrew/cask/download.rb @@ -3,7 +3,7 @@ require "cask/cache" require "cask/quarantine" require "cask/verify" -module Hbc +module Cask class Download attr_reader :cask diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index eac2880d0b..078c722074 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -20,7 +20,7 @@ require "cask/dsl/version" require "cask/url" -module Hbc +module Cask class DSL ORDINARY_ARTIFACT_CLASSES = [ Artifact::Installer, diff --git a/Library/Homebrew/cask/dsl/appcast.rb b/Library/Homebrew/cask/dsl/appcast.rb index 9174cca5ea..016b0ac5ce 100644 --- a/Library/Homebrew/cask/dsl/appcast.rb +++ b/Library/Homebrew/cask/dsl/appcast.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL class Appcast attr_reader :uri, :checkpoint, :parameters diff --git a/Library/Homebrew/cask/dsl/base.rb b/Library/Homebrew/cask/dsl/base.rb index b97c4e104e..d526752596 100644 --- a/Library/Homebrew/cask/dsl/base.rb +++ b/Library/Homebrew/cask/dsl/base.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL class Base extend Forwardable diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index b3789a6621..806a6c76d8 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -5,7 +5,7 @@ # ( The return value of the last method in the block is also sent # to the output by the caller, but that feature is only for the # convenience of Cask authors. ) -module Hbc +module Cask class DSL class Caveats < Base def initialize(*args) diff --git a/Library/Homebrew/cask/dsl/conflicts_with.rb b/Library/Homebrew/cask/dsl/conflicts_with.rb index dfaa55a5c2..10cd3f0728 100644 --- a/Library/Homebrew/cask/dsl/conflicts_with.rb +++ b/Library/Homebrew/cask/dsl/conflicts_with.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL class ConflictsWith VALID_KEYS = Set.new [ diff --git a/Library/Homebrew/cask/dsl/container.rb b/Library/Homebrew/cask/dsl/container.rb index ef2c8d2c38..5aa1619d15 100644 --- a/Library/Homebrew/cask/dsl/container.rb +++ b/Library/Homebrew/cask/dsl/container.rb @@ -1,6 +1,6 @@ require "unpack_strategy" -module Hbc +module Cask class DSL class Container VALID_KEYS = Set.new [ diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index 2a377a1bd8..51f31f5736 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -1,6 +1,6 @@ require "rubygems" -module Hbc +module Cask class DSL class DependsOn < DelegateClass(Hash) VALID_KEYS = Set.new [ diff --git a/Library/Homebrew/cask/dsl/postflight.rb b/Library/Homebrew/cask/dsl/postflight.rb index 63ce8f6318..a2c0db3bcd 100644 --- a/Library/Homebrew/cask/dsl/postflight.rb +++ b/Library/Homebrew/cask/dsl/postflight.rb @@ -1,6 +1,6 @@ require "cask/staged" -module Hbc +module Cask class DSL class Postflight < Base include Staged diff --git a/Library/Homebrew/cask/dsl/preflight.rb b/Library/Homebrew/cask/dsl/preflight.rb index 55a7787064..0eab22179e 100644 --- a/Library/Homebrew/cask/dsl/preflight.rb +++ b/Library/Homebrew/cask/dsl/preflight.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL class Preflight < Base include Staged diff --git a/Library/Homebrew/cask/dsl/uninstall_postflight.rb b/Library/Homebrew/cask/dsl/uninstall_postflight.rb index f481cc3573..458d96c733 100644 --- a/Library/Homebrew/cask/dsl/uninstall_postflight.rb +++ b/Library/Homebrew/cask/dsl/uninstall_postflight.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL class UninstallPostflight < Base end diff --git a/Library/Homebrew/cask/dsl/uninstall_preflight.rb b/Library/Homebrew/cask/dsl/uninstall_preflight.rb index 5e00a2790f..38376f272d 100644 --- a/Library/Homebrew/cask/dsl/uninstall_preflight.rb +++ b/Library/Homebrew/cask/dsl/uninstall_preflight.rb @@ -1,6 +1,6 @@ require "cask/staged" -module Hbc +module Cask class DSL class UninstallPreflight < Base include Staged diff --git a/Library/Homebrew/cask/dsl/version.rb b/Library/Homebrew/cask/dsl/version.rb index cac0490dff..4e5d608e9e 100644 --- a/Library/Homebrew/cask/dsl/version.rb +++ b/Library/Homebrew/cask/dsl/version.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL class Version < ::String DIVIDERS = { diff --git a/Library/Homebrew/cask/exceptions.rb b/Library/Homebrew/cask/exceptions.rb index 7e092e57e1..b9389374cc 100644 --- a/Library/Homebrew/cask/exceptions.rb +++ b/Library/Homebrew/cask/exceptions.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class CaskError < RuntimeError; end class AbstractCaskErrorWithToken < CaskError diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index a029984c57..6aceb51a93 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -11,10 +11,10 @@ require "cask/quarantine" require "cgi" -module Hbc +module Cask class Installer extend Predicable - # TODO: it is unwise for Hbc::Staged to be a module, when we are + # TODO: it is unwise for Cask::Staged to be a module, when we are # dealing with both staged and unstaged Casks here. This should # either be a class which is only sometimes instantiated, or there # should be explicit checks on whether staged state is valid in @@ -54,7 +54,7 @@ module Hbc end def fetch - odebug "Hbc::Installer#fetch" + odebug "Cask::Installer#fetch" satisfy_dependencies @@ -64,7 +64,7 @@ module Hbc end def stage - odebug "Hbc::Installer#stage" + odebug "Cask::Installer#stage" Caskroom.ensure_caskroom_exists @@ -78,7 +78,7 @@ module Hbc end def install - odebug "Hbc::Installer#install" + odebug "Cask::Installer#install" if @cask.installed? && !force? && !@reinstall && !upgrade? raise CaskAlreadyInstalledError, @cask @@ -119,7 +119,7 @@ module Hbc end def reinstall - odebug "Hbc::Installer#reinstall" + odebug "Cask::Installer#reinstall" @reinstall = true install end diff --git a/Library/Homebrew/cask/metadata.rb b/Library/Homebrew/cask/metadata.rb index a1f5e10bb5..8335232dee 100644 --- a/Library/Homebrew/cask/metadata.rb +++ b/Library/Homebrew/cask/metadata.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Metadata METADATA_SUBDIR = ".metadata".freeze diff --git a/Library/Homebrew/cask/pkg.rb b/Library/Homebrew/cask/pkg.rb index 5d91adb087..4797a5c875 100644 --- a/Library/Homebrew/cask/pkg.rb +++ b/Library/Homebrew/cask/pkg.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class Pkg def self.all_matching(regexp, command) command.run("/usr/sbin/pkgutil", args: ["--pkgs=#{regexp}"]).stdout.split("\n").map do |package_id| diff --git a/Library/Homebrew/cask/quarantine.rb b/Library/Homebrew/cask/quarantine.rb index c55a93e6a8..902c860b70 100644 --- a/Library/Homebrew/cask/quarantine.rb +++ b/Library/Homebrew/cask/quarantine.rb @@ -1,5 +1,5 @@ require "development_tools" -module Hbc +module Cask module Quarantine module_function diff --git a/Library/Homebrew/cask/staged.rb b/Library/Homebrew/cask/staged.rb index c87b742e0b..2330427217 100644 --- a/Library/Homebrew/cask/staged.rb +++ b/Library/Homebrew/cask/staged.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Staged def info_plist_file(index = 0) index = 0 if index == :first diff --git a/Library/Homebrew/cask/topological_hash.rb b/Library/Homebrew/cask/topological_hash.rb index 2e484a28d3..8320bbb89c 100644 --- a/Library/Homebrew/cask/topological_hash.rb +++ b/Library/Homebrew/cask/topological_hash.rb @@ -1,7 +1,7 @@ require "tsort" # a basic topologically sortable hashmap -module Hbc +module Cask class TopologicalHash < Hash include TSort diff --git a/Library/Homebrew/cask/utils.rb b/Library/Homebrew/cask/utils.rb index c866854a10..cbbf1c0303 100644 --- a/Library/Homebrew/cask/utils.rb +++ b/Library/Homebrew/cask/utils.rb @@ -4,7 +4,7 @@ require "stringio" BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs".freeze -module Hbc +module Cask module Utils def self.gain_permissions_remove(path, command: SystemCommand) if path.respond_to?(:rmtree) && path.exist? diff --git a/Library/Homebrew/cask/verify.rb b/Library/Homebrew/cask/verify.rb index a46b607552..06bc03d8cd 100644 --- a/Library/Homebrew/cask/verify.rb +++ b/Library/Homebrew/cask/verify.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Verify module_function diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 45e3b35ddc..f7d7263444 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -112,8 +112,8 @@ module CleanupRefinement return false unless name = basename.to_s[/\A(.*?)\-\-/, 1] cask = begin - Hbc::CaskLoader.load(name) - rescue Hbc::CaskUnavailableError + Cask::CaskLoader.load(name) + rescue Cask::CaskUnavailableError return false end @@ -172,8 +172,8 @@ module Homebrew end cask = begin - Hbc::CaskLoader.load(arg) - rescue Hbc::CaskUnavailableError + Cask::CaskLoader.load(arg) + rescue Cask::CaskUnavailableError nil end diff --git a/Library/Homebrew/cmd/cask.rb b/Library/Homebrew/cmd/cask.rb index ac37399e2b..667c25607b 100644 --- a/Library/Homebrew/cmd/cask.rb +++ b/Library/Homebrew/cmd/cask.rb @@ -4,6 +4,6 @@ module Homebrew module_function def cask - Hbc::Cmd.run(*ARGV) + Cask::Cmd.run(*ARGV) end end diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index a8d7ccca5f..dd8ecbbea4 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -64,7 +64,7 @@ module Homebrew if args.remaining.empty? if args.casks? - puts Formatter.columns(Hbc::Cask.to_a.map(&:full_name).sort) + puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort) else puts Formatter.columns(Formula.full_names.sort) end diff --git a/Library/Homebrew/compat/cask.rb b/Library/Homebrew/compat/cask.rb index 69d0cc7fa9..03e78d7de4 100644 --- a/Library/Homebrew/compat/cask.rb +++ b/Library/Homebrew/compat/cask.rb @@ -6,7 +6,7 @@ require "compat/cask/cache" require "compat/cask/caskroom" require "compat/cask/dsl" -module Hbc +module Cask class << self module Compat def init diff --git a/Library/Homebrew/compat/cask/cache.rb b/Library/Homebrew/compat/cask/cache.rb index 68b6d4f869..b70f0412a2 100644 --- a/Library/Homebrew/compat/cask/cache.rb +++ b/Library/Homebrew/compat/cask/cache.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Cache class << self module Compat diff --git a/Library/Homebrew/compat/cask/cask_loader.rb b/Library/Homebrew/compat/cask/cask_loader.rb index c3e456bf27..2ef242c150 100644 --- a/Library/Homebrew/compat/cask/cask_loader.rb +++ b/Library/Homebrew/compat/cask/cask_loader.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module CaskLoader class FromContentLoader; end diff --git a/Library/Homebrew/compat/cask/caskroom.rb b/Library/Homebrew/compat/cask/caskroom.rb index 328a042eb7..87597c05d2 100644 --- a/Library/Homebrew/compat/cask/caskroom.rb +++ b/Library/Homebrew/compat/cask/caskroom.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask module Caskroom class << self module Compat diff --git a/Library/Homebrew/compat/cask/cmd/--version.rb b/Library/Homebrew/compat/cask/cmd/--version.rb index 1592b3bb7a..25f9302054 100644 --- a/Library/Homebrew/compat/cask/cmd/--version.rb +++ b/Library/Homebrew/compat/cask/cmd/--version.rb @@ -1,7 +1,7 @@ require "cask/cmd/abstract_command" require "cmd/--version" -module Hbc +module Cask class Cmd class Version < AbstractCommand def self.command_name diff --git a/Library/Homebrew/compat/cask/cmd/cleanup.rb b/Library/Homebrew/compat/cask/cmd/cleanup.rb index 878d9fe432..06ed45535c 100644 --- a/Library/Homebrew/compat/cask/cmd/cleanup.rb +++ b/Library/Homebrew/compat/cask/cmd/cleanup.rb @@ -3,7 +3,7 @@ require "cleanup" using CleanupRefinement -module Hbc +module Cask class Cmd class Cleanup < AbstractCommand OUTDATED_DAYS = 10 diff --git a/Library/Homebrew/compat/cask/cmd/search.rb b/Library/Homebrew/compat/cask/cmd/search.rb index fca45f77bf..8e0ae4f43e 100644 --- a/Library/Homebrew/compat/cask/cmd/search.rb +++ b/Library/Homebrew/compat/cask/cmd/search.rb @@ -1,7 +1,7 @@ require "cask/cmd/abstract_command" require "cmd/search" -module Hbc +module Cask class Cmd module Compat class Search < AbstractCommand diff --git a/Library/Homebrew/compat/cask/dsl.rb b/Library/Homebrew/compat/cask/dsl.rb index 526d57f9dc..dbfe42ffb9 100644 --- a/Library/Homebrew/compat/cask/dsl.rb +++ b/Library/Homebrew/compat/cask/dsl.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask class DSL module Compat def gpg(*) diff --git a/Library/Homebrew/extend/os/mac/search.rb b/Library/Homebrew/extend/os/mac/search.rb index 9aada104b6..d26cf17276 100644 --- a/Library/Homebrew/extend/os/mac/search.rb +++ b/Library/Homebrew/extend/os/mac/search.rb @@ -10,9 +10,9 @@ module Homebrew puts ohai "Casks" - Hbc::Cask.to_a.extend(Searchable) - .search(string_or_regex, &:name) - .each do |cask| + Cask::Cask.to_a.extend(Searchable) + .search(string_or_regex, &:name) + .each do |cask| puts "#{Tty.bold}#{cask.token}:#{Tty.reset} #{cask.name.join(", ")}" end end @@ -20,13 +20,13 @@ module Homebrew def search_casks(string_or_regex) if string_or_regex.is_a?(String) && string_or_regex.match?(HOMEBREW_TAP_CASK_REGEX) return begin - [Hbc::CaskLoader.load(string_or_regex).token] - rescue Hbc::CaskUnavailableError + [Cask::CaskLoader.load(string_or_regex).token] + rescue Cask::CaskUnavailableError [] end end - results = Hbc::Cask.search(string_or_regex, &:token).sort_by(&:token) + results = Cask::Cask.search(string_or_regex, &:token).sort_by(&:token) results.map do |cask| if cask.installed? diff --git a/Library/Homebrew/test/cask/accessibility_spec.rb b/Library/Homebrew/test/cask/accessibility_spec.rb index 7f4a943ec5..e8b0df2820 100644 --- a/Library/Homebrew/test/cask/accessibility_spec.rb +++ b/Library/Homebrew/test/cask/accessibility_spec.rb @@ -1,9 +1,9 @@ # TODO: this test should be named after the corresponding class, once # that class is abstracted from installer.rb. describe "Accessibility Access", :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-accessibility-access")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-accessibility-access")) } let(:fake_system_command) { class_double(SystemCommand) } - let(:installer) { Hbc::Installer.new(cask, command: fake_system_command) } + let(:installer) { Cask::Installer.new(cask, command: fake_system_command) } before do allow(MacOS).to receive(:version).and_return(MacOS::Version.new(macos_version)) diff --git a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb index 7197654be0..28d74264da 100644 --- a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb +++ b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb @@ -1,6 +1,6 @@ -describe Hbc::Artifact::App, :cask do +describe Cask::Artifact::App, :cask do describe "activate to alternate target" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-alt-target")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-alt-target")) } let(:install_phase) { lambda do @@ -11,7 +11,7 @@ describe Hbc::Artifact::App, :cask do } let(:source_path) { cask.staged_path.join("Caffeine.app") } - let(:target_path) { Hbc::Config.global.appdir.join("AnotherName.app") } + let(:target_path) { Cask::Config.global.appdir.join("AnotherName.app") } before do InstallHelper.install_without_artifacts(cask) @@ -29,7 +29,7 @@ describe Hbc::Artifact::App, :cask do describe "when app is in a subdirectory" do let(:cask) { - Hbc::Cask.new("subdir") do + Cask::Cask.new("subdir") do url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://example.com/local-caffeine" version "1.2.3" @@ -58,14 +58,14 @@ describe Hbc::Artifact::App, :cask do expect(target_path).to be_a_directory expect(source_path).not_to exist - expect(Hbc::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist + expect(Cask::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist expect(cask.staged_path.join("Caffeine Deluxe.app")).to be_a_directory end it "avoids clobbering an existing app by moving over it" do target_path.mkpath - expect(install_phase).to raise_error(Hbc::CaskError, "It seems there is already an App at '#{target_path}'.") + expect(install_phase).to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path}'.") expect(source_path).to be_a_directory expect(target_path).to be_a_directory diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index 8d036eaf51..d3c10ea925 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -1,11 +1,11 @@ -describe Hbc::Artifact::App, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("local-caffeine")) } +describe Cask::Artifact::App, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("local-caffeine")) } let(:command) { SystemCommand } let(:force) { false } let(:app) { cask.artifacts.find { |a| a.is_a?(described_class) } } let(:source_path) { cask.staged_path.join("Caffeine.app") } - let(:target_path) { Hbc::Config.global.appdir.join("Caffeine.app") } + let(:target_path) { Cask::Config.global.appdir.join("Caffeine.app") } let(:install_phase) { app.install_phase(command: command, force: force) } let(:uninstall_phase) { app.uninstall_phase(command: command, force: force) } @@ -24,7 +24,7 @@ describe Hbc::Artifact::App, :cask do describe "when app is in a subdirectory" do let(:cask) { - Hbc::Cask.new("subdir") do + Cask::Cask.new("subdir") do url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://example.com/local-caffeine" version "1.2.3" @@ -53,7 +53,7 @@ describe Hbc::Artifact::App, :cask do expect(target_path).to be_a_directory expect(source_path).not_to exist - expect(Hbc::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist + expect(Cask::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist expect(cask.staged_path.join("Caffeine Deluxe.app")).to exist end @@ -64,7 +64,7 @@ describe Hbc::Artifact::App, :cask do it "avoids clobbering an existing app" do expect { install_phase }.to raise_error( - Hbc::CaskError, + Cask::CaskError, "It seems there is already an App at '#{target_path}'.", ) @@ -80,7 +80,7 @@ describe Hbc::Artifact::App, :cask do let(:force) { true } before do - allow(Hbc::Utils).to receive(:current_user).and_return("fake_user") + allow(Cask::Utils).to receive(:current_user).and_return("fake_user") end describe "target is both writable and user-owned" do @@ -167,7 +167,7 @@ describe Hbc::Artifact::App, :cask do it "leaves the target alone" do expect { install_phase }.to raise_error( - Hbc::CaskError, "It seems there is already an App at '#{target_path}'." + Cask::CaskError, "It seems there is already an App at '#{target_path}'." ) expect(target_path).to be_a_symlink end @@ -203,7 +203,7 @@ describe Hbc::Artifact::App, :cask do message = "It seems the App source '#{source_path}' is not there." - expect { install_phase }.to raise_error(Hbc::CaskError, message) + expect { install_phase }.to raise_error(Cask::CaskError, message) end end diff --git a/Library/Homebrew/test/cask/artifact/binary_spec.rb b/Library/Homebrew/test/cask/artifact/binary_spec.rb index cdee0860f6..bd70904ebc 100644 --- a/Library/Homebrew/test/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/test/cask/artifact/binary_spec.rb @@ -1,11 +1,11 @@ -describe Hbc::Artifact::Binary, :cask do +describe Cask::Artifact::Binary, :cask do let(:cask) { - Hbc::CaskLoader.load(cask_path("with-binary")).tap do |cask| + Cask::CaskLoader.load(cask_path("with-binary")).tap do |cask| InstallHelper.install_without_artifacts(cask) end } let(:artifacts) { cask.artifacts.select { |a| a.is_a?(described_class) } } - let(:expected_path) { Hbc::Config.global.binarydir.join("binary") } + let(:expected_path) { Cask::Config.global.binarydir.join("binary") } after do FileUtils.rm expected_path if expected_path.exist? @@ -13,11 +13,11 @@ describe Hbc::Artifact::Binary, :cask do context "when --no-binaries is specified" do let(:cask) { - Hbc::CaskLoader.load(cask_path("with-binary")) + Cask::CaskLoader.load(cask_path("with-binary")) } it "doesn't link the binary when --no-binaries is specified" do - Hbc::Installer.new(cask, binaries: false).install + Cask::Installer.new(cask, binaries: false).install expect(expected_path).not_to exist end end @@ -33,12 +33,12 @@ describe Hbc::Artifact::Binary, :cask do context "when the binary is not executable" do let(:cask) { - Hbc::CaskLoader.load(cask_path("with-non-executable-binary")).tap do |cask| + Cask::CaskLoader.load(cask_path("with-non-executable-binary")).tap do |cask| InstallHelper.install_without_artifacts(cask) end } - let(:expected_path) { Hbc::Config.global.binarydir.join("naked_non_executable") } + let(:expected_path) { Cask::Config.global.binarydir.join("naked_non_executable") } it "makes the binary executable" do expect(FileUtils).to receive(:chmod) @@ -60,7 +60,7 @@ describe Hbc::Artifact::Binary, :cask do artifacts.each do |artifact| artifact.install_phase(command: NeverSudoSystemCommand, force: false) end - }.to raise_error(Hbc::CaskError) + }.to raise_error(Cask::CaskError) expect(expected_path).not_to be :symlink? end @@ -76,7 +76,7 @@ describe Hbc::Artifact::Binary, :cask do end it "creates parent directory if it doesn't exist" do - FileUtils.rmdir Hbc::Config.global.binarydir + FileUtils.rmdir Cask::Config.global.binarydir artifacts.each do |artifact| artifact.install_phase(command: NeverSudoSystemCommand, force: false) @@ -87,13 +87,13 @@ describe Hbc::Artifact::Binary, :cask do context "binary is inside an app package" do let(:cask) { - Hbc::CaskLoader.load(cask_path("with-embedded-binary")).tap do |cask| + Cask::CaskLoader.load(cask_path("with-embedded-binary")).tap do |cask| InstallHelper.install_without_artifacts(cask) end } it "links the binary to the proper directory" do - cask.artifacts.select { |a| a.is_a?(Hbc::Artifact::App) }.each do |artifact| + cask.artifacts.select { |a| a.is_a?(Cask::Artifact::App) }.each do |artifact| artifact.install_phase(command: NeverSudoSystemCommand, force: false) end artifacts.each do |artifact| diff --git a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb index 981228917f..ff28392175 100644 --- a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb +++ b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb @@ -1,5 +1,5 @@ -describe Hbc::Artifact::Artifact, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-generic-artifact")) } +describe Cask::Artifact::Artifact, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("with-generic-artifact")) } let(:install_phase) { lambda do @@ -10,7 +10,7 @@ describe Hbc::Artifact::Artifact, :cask do } let(:source_path) { cask.staged_path.join("Caffeine.app") } - let(:target_path) { Hbc::Config.global.appdir.join("Caffeine.app") } + let(:target_path) { Cask::Config.global.appdir.join("Caffeine.app") } before do InstallHelper.install_without_artifacts(cask) @@ -19,8 +19,8 @@ describe Hbc::Artifact::Artifact, :cask do context "without target" do it "fails to load" do expect { - Hbc::CaskLoader.load(cask_path("invalid/invalid-generic-artifact-no-target")) - }.to raise_error(Hbc::CaskInvalidError, /target required for Generic Artifact/) + Cask::CaskLoader.load(cask_path("invalid/invalid-generic-artifact-no-target")) + }.to raise_error(Cask::CaskInvalidError, /target required for Generic Artifact/) end end @@ -36,7 +36,7 @@ describe Hbc::Artifact::Artifact, :cask do expect { install_phase.call - }.to raise_error(Hbc::CaskError) + }.to raise_error(Cask::CaskError) expect(source_path).to be_a_directory expect(target_path).to be_a_directory diff --git a/Library/Homebrew/test/cask/artifact/installer_spec.rb b/Library/Homebrew/test/cask/artifact/installer_spec.rb index bfb27f43cd..56fa78128f 100644 --- a/Library/Homebrew/test/cask/artifact/installer_spec.rb +++ b/Library/Homebrew/test/cask/artifact/installer_spec.rb @@ -1,6 +1,6 @@ -describe Hbc::Artifact::Installer, :cask do +describe Cask::Artifact::Installer, :cask do let(:staged_path) { mktmpdir } - let(:cask) { instance_double(Hbc::Cask, staged_path: staged_path, config: nil) } + let(:cask) { instance_double(Cask::Cask, staged_path: staged_path, config: nil) } subject(:installer) { described_class.new(cask, **args) } let(:command) { SystemCommand } diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index 7a660600d1..be11a187ca 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -1,5 +1,5 @@ -describe Hbc::Artifact::Pkg, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-installable")) } +describe Cask::Artifact::Pkg, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("with-installable")) } let(:fake_system_command) { class_double(SystemCommand) } before do @@ -27,7 +27,7 @@ describe Hbc::Artifact::Pkg, :cask do end describe "choices" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-choices")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-choices")) } it "passes the choice changes xml to the system installer" do pkg = cask.artifacts.find { |a| a.is_a?(described_class) } diff --git a/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb b/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb index a49c900fcf..75c6d10d0b 100644 --- a/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb +++ b/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb @@ -1,10 +1,10 @@ -describe Hbc::Artifact::PostflightBlock, :cask do +describe Cask::Artifact::PostflightBlock, :cask do describe "install_phase" do it "calls the specified block after installing, passing a Cask mini-dsl" do called = false yielded_arg = nil - cask = Hbc::Cask.new("with-postflight") do + cask = Cask::Cask.new("with-postflight") do postflight do |c| called = true yielded_arg = c @@ -16,7 +16,7 @@ describe Hbc::Artifact::PostflightBlock, :cask do end expect(called).to be true - expect(yielded_arg).to be_kind_of(Hbc::DSL::Postflight) + expect(yielded_arg).to be_kind_of(Cask::DSL::Postflight) end end @@ -25,7 +25,7 @@ describe Hbc::Artifact::PostflightBlock, :cask do called = false yielded_arg = nil - cask = Hbc::Cask.new("with-uninstall-postflight") do + cask = Cask::Cask.new("with-uninstall-postflight") do uninstall_postflight do |c| called = true yielded_arg = c @@ -37,7 +37,7 @@ describe Hbc::Artifact::PostflightBlock, :cask do end expect(called).to be true - expect(yielded_arg).to be_kind_of(Hbc::DSL::UninstallPostflight) + expect(yielded_arg).to be_kind_of(Cask::DSL::UninstallPostflight) end end end diff --git a/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb b/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb index 7a00839e27..8d07807f07 100644 --- a/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb +++ b/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb @@ -1,10 +1,10 @@ -describe Hbc::Artifact::PreflightBlock, :cask do +describe Cask::Artifact::PreflightBlock, :cask do describe "install_phase" do it "calls the specified block before installing, passing a Cask mini-dsl" do called = false yielded_arg = nil - cask = Hbc::Cask.new("with-preflight") do + cask = Cask::Cask.new("with-preflight") do preflight do |c| called = true yielded_arg = c @@ -16,7 +16,7 @@ describe Hbc::Artifact::PreflightBlock, :cask do end expect(called).to be true - expect(yielded_arg).to be_kind_of Hbc::DSL::Preflight + expect(yielded_arg).to be_kind_of Cask::DSL::Preflight end end @@ -25,7 +25,7 @@ describe Hbc::Artifact::PreflightBlock, :cask do called = false yielded_arg = nil - cask = Hbc::Cask.new("with-uninstall-preflight") do + cask = Cask::Cask.new("with-uninstall-preflight") do uninstall_preflight do |c| called = true yielded_arg = c @@ -37,7 +37,7 @@ describe Hbc::Artifact::PreflightBlock, :cask do end expect(called).to be true - expect(yielded_arg).to be_kind_of Hbc::DSL::UninstallPreflight + expect(yielded_arg).to be_kind_of Cask::DSL::UninstallPreflight end end end diff --git a/Library/Homebrew/test/cask/artifact/suite_spec.rb b/Library/Homebrew/test/cask/artifact/suite_spec.rb index 55cd1d9ce5..87f821aea2 100644 --- a/Library/Homebrew/test/cask/artifact/suite_spec.rb +++ b/Library/Homebrew/test/cask/artifact/suite_spec.rb @@ -1,5 +1,5 @@ -describe Hbc::Artifact::Suite, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-suite")) } +describe Cask::Artifact::Suite, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("with-suite")) } let(:install_phase) { lambda do @@ -9,7 +9,7 @@ describe Hbc::Artifact::Suite, :cask do end } - let(:target_path) { Hbc::Config.global.appdir.join("Caffeine") } + let(:target_path) { Cask::Config.global.appdir.join("Caffeine") } let(:source_path) { cask.staged_path.join("Caffeine") } before do @@ -27,7 +27,7 @@ describe Hbc::Artifact::Suite, :cask do expect { install_phase.call - }.to raise_error(Hbc::CaskError) + }.to raise_error(Cask::CaskError) expect(source_path).to be_a_directory expect(target_path).to be_a_directory diff --git a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb index 4c56428d78..a5375125ba 100644 --- a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb +++ b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb @@ -1,6 +1,6 @@ -describe Hbc::Artifact::App, :cask do +describe Cask::Artifact::App, :cask do describe "multiple apps" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-two-apps-correct")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-correct")) } let(:install_phase) { lambda do @@ -11,10 +11,10 @@ describe Hbc::Artifact::App, :cask do } let(:source_path_mini) { cask.staged_path.join("Caffeine Mini.app") } - let(:target_path_mini) { Hbc::Config.global.appdir.join("Caffeine Mini.app") } + let(:target_path_mini) { Cask::Config.global.appdir.join("Caffeine Mini.app") } let(:source_path_pro) { cask.staged_path.join("Caffeine Pro.app") } - let(:target_path_pro) { Hbc::Config.global.appdir.join("Caffeine Pro.app") } + let(:target_path_pro) { Cask::Config.global.appdir.join("Caffeine Pro.app") } before do InstallHelper.install_without_artifacts(cask) @@ -31,7 +31,7 @@ describe Hbc::Artifact::App, :cask do end describe "when apps are in a subdirectory" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-two-apps-subdir")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-subdir")) } it "installs both apps using the proper target directory" do install_phase.call @@ -52,7 +52,7 @@ describe Hbc::Artifact::App, :cask do expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist - expect(Hbc::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist + expect(Cask::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist expect(cask.staged_path.join("Caffeine Deluxe.app")).to exist end @@ -64,7 +64,7 @@ describe Hbc::Artifact::App, :cask do expect(install_phase).to output(<<~EOS).to_stdout ==> Moving App 'Caffeine Pro.app' to '#{target_path_pro}' EOS - }.to raise_error(Hbc::CaskError, "It seems there is already an App at '#{target_path_mini}'.") + }.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path_mini}'.") expect(source_path_mini).to be_a_directory expect(target_path_mini).to be_a_directory @@ -78,7 +78,7 @@ describe Hbc::Artifact::App, :cask do expect(install_phase).to output(<<~EOS).to_stdout ==> Moving App 'Caffeine Mini.app' to '#{target_path_mini}' EOS - }.to raise_error(Hbc::CaskError, "It seems there is already an App at '#{target_path_pro}'.") + }.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path_pro}'.") expect(source_path_pro).to be_a_directory expect(target_path_pro).to be_a_directory diff --git a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb index b2df115eb2..863db064e3 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb @@ -1,5 +1,5 @@ -describe Hbc::Artifact::Zap, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-installable")) } +describe Cask::Artifact::Zap, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("with-installable")) } let(:zap_artifact) { cask.artifacts.find { |a| a.is_a?(described_class) } diff --git a/Library/Homebrew/test/cask/artifact/uninstall_spec.rb b/Library/Homebrew/test/cask/artifact/uninstall_spec.rb index 49a6dce9fe..febc881f83 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_spec.rb @@ -1,6 +1,6 @@ require_relative "uninstall_zap_shared_examples" -describe Hbc::Artifact::Uninstall, :cask do +describe Cask::Artifact::Uninstall, :cask do describe "#uninstall_phase" do include_examples "#uninstall_phase or #zap_phase" end diff --git a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb index 31ed8d4ff4..1102091806 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb @@ -6,7 +6,7 @@ shared_examples "#uninstall_phase or #zap_phase" do subject { artifact.public_send(:"#{artifact_dsl_key}_phase", command: fake_system_command) } context "using :launchctl" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-launchctl")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-launchctl")) } let(:launchctl_list_cmd) { %w[/bin/launchctl list my.fancy.package.service] } let(:launchctl_remove_cmd) { %w[/bin/launchctl remove my.fancy.package.service] } let(:unknown_response) { "launchctl list returned unknown response\n" } @@ -61,16 +61,16 @@ shared_examples "#uninstall_phase or #zap_phase" do context "using :pkgutil" do let(:fake_system_command) { class_double(SystemCommand) } - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-pkgutil")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-pkgutil")) } let(:main_pkg_id) { "my.fancy.package.main" } let(:agent_pkg_id) { "my.fancy.package.agent" } it "is supported" do - main_pkg = Hbc::Pkg.new(main_pkg_id, fake_system_command) - agent_pkg = Hbc::Pkg.new(agent_pkg_id, fake_system_command) + main_pkg = Cask::Pkg.new(main_pkg_id, fake_system_command) + agent_pkg = Cask::Pkg.new(agent_pkg_id, fake_system_command) - expect(Hbc::Pkg).to receive(:all_matching).and_return( + expect(Cask::Pkg).to receive(:all_matching).and_return( [ main_pkg, agent_pkg, @@ -85,7 +85,7 @@ shared_examples "#uninstall_phase or #zap_phase" do end context "using :kext" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-kext")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-kext")) } let(:kext_id) { "my.fancy.package.kernelextension" } it "is supported" do @@ -110,7 +110,7 @@ shared_examples "#uninstall_phase or #zap_phase" do end context "using :quit" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-quit")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-quit")) } let(:bundle_id) { "my.fancy.package.app" } let(:quit_application_script) do %Q(tell application id "#{bundle_id}" to quit) @@ -130,7 +130,7 @@ shared_examples "#uninstall_phase or #zap_phase" do end context "using :signal" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-signal")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-signal")) } let(:bundle_id) { "my.fancy.package.app" } let(:signals) { %w[TERM KILL] } let(:unix_pids) { [12_345, 67_890] } @@ -172,10 +172,10 @@ shared_examples "#uninstall_phase or #zap_phase" do end let(:fake_system_command) { NeverSudoSystemCommand } - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-#{directive}")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-#{directive}")) } before(:each) do - allow_any_instance_of(Hbc::Artifact::AbstractUninstall).to receive(:trash_paths) + allow_any_instance_of(Cask::Artifact::AbstractUninstall).to receive(:trash_paths) .and_wrap_original do |method, *args| result = method.call(*args) FileUtils.rm_rf result.stdout.split("\0") @@ -198,7 +198,7 @@ shared_examples "#uninstall_phase or #zap_phase" do context "using :rmdir" do let(:fake_system_command) { NeverSudoSystemCommand } - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-rmdir")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-rmdir")) } let(:empty_directory) { Pathname.new("#{TEST_TMPDIR}/empty_directory_path") } let(:ds_store) { empty_directory.join(".DS_Store") } @@ -226,7 +226,7 @@ shared_examples "#uninstall_phase or #zap_phase" do context "using #{script_type.inspect}" do let(:fake_system_command) { NeverSudoSystemCommand } let(:token) { "with-#{artifact_dsl_key}-#{script_type}".tr("_", "-") } - let(:cask) { Hbc::CaskLoader.load(cask_path(token.to_s)) } + let(:cask) { Cask::CaskLoader.load(cask_path(token.to_s)) } let(:script_pathname) { cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool") } it "is supported" do @@ -252,7 +252,7 @@ shared_examples "#uninstall_phase or #zap_phase" do end context "using :login_item" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-login-item")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-#{artifact_dsl_key}-login-item")) } it "is supported" do FakeSystemCommand.expects_command( diff --git a/Library/Homebrew/test/cask/artifact/zap_spec.rb b/Library/Homebrew/test/cask/artifact/zap_spec.rb index 0a09d9710e..035ec67d42 100644 --- a/Library/Homebrew/test/cask/artifact/zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/zap_spec.rb @@ -1,6 +1,6 @@ require_relative "uninstall_zap_shared_examples" -describe Hbc::Artifact::Zap, :cask do +describe Cask::Artifact::Zap, :cask do describe "#zap_phase" do include_examples "#uninstall_phase or #zap_phase" end diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index b5bb990e71..9d041529ec 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::Audit, :cask do +describe Cask::Audit, :cask do def include_msg?(messages, msg) if msg.is_a?(Regexp) Array(messages).any? { |m| m =~ msg } @@ -35,14 +35,14 @@ describe Hbc::Audit, :cask do end end - let(:cask) { instance_double(Hbc::Cask) } + let(:cask) { instance_double(Cask::Cask) } let(:download) { false } let(:check_token_conflicts) { false } let(:fake_system_command) { class_double(SystemCommand) } let(:audit) { - Hbc::Audit.new(cask, download: download, - check_token_conflicts: check_token_conflicts, - command: fake_system_command) + Cask::Audit.new(cask, download: download, + check_token_conflicts: check_token_conflicts, + command: fake_system_command) } describe "#result" do @@ -81,7 +81,7 @@ describe Hbc::Audit, :cask do describe "#run!" do subject { audit.run! } - let(:cask) { Hbc::CaskLoader.load(cask_token) } + let(:cask) { Cask::CaskLoader.load(cask_token) } describe "required stanzas" do %w[version sha256 url name homepage].each do |stanza| @@ -530,9 +530,9 @@ describe Hbc::Audit, :cask do describe "audit of downloads" do let(:cask_token) { "with-binary" } - let(:cask) { Hbc::CaskLoader.load(cask_token) } - let(:download) { instance_double(Hbc::Download) } - let(:verify) { class_double(Hbc::Verify).as_stubbed_const } + let(:cask) { Cask::CaskLoader.load(cask_token) } + let(:download) { instance_double(Cask::Download) } + let(:verify) { class_double(Cask::Verify).as_stubbed_const } let(:error_msg) { "Download Failed" } context "when download and verification succeed" do @@ -563,7 +563,7 @@ describe Hbc::Audit, :cask do end context "when an exception is raised" do - let(:cask) { instance_double(Hbc::Cask) } + let(:cask) { instance_double(Cask::Cask) } before do expect(cask).to receive(:version).and_raise(StandardError.new) diff --git a/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb index e1b718e5a7..ad9c85a68c 100644 --- a/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CaskLoader::FromPathLoader do +describe Cask::CaskLoader::FromPathLoader do describe "#load" do context "when the file does not contain a cask" do let(:path) { @@ -12,7 +12,7 @@ describe Hbc::CaskLoader::FromPathLoader do it "raises an error" do expect { described_class.new(path).load - }.to raise_error(Hbc::CaskUnreadableError, /does not contain a cask/) + }.to raise_error(Cask::CaskUnreadableError, /does not contain a cask/) end end @@ -28,7 +28,7 @@ describe Hbc::CaskLoader::FromPathLoader do it "raises an error" do expect { described_class.new(path).load - }.to raise_error(Hbc::CaskUnreadableError, /undefined local variable or method/) + }.to raise_error(Cask::CaskUnreadableError, /undefined local variable or method/) end end end diff --git a/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb index 945340d005..22f1b8530a 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CaskLoader::FromContentLoader do +describe Cask::CaskLoader::FromContentLoader do alias_matcher :be_able_to_load, :be_can_load describe "::can_load?" do diff --git a/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb index a1522bdfcc..60c2b27683 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CaskLoader::FromURILoader do +describe Cask::CaskLoader::FromURILoader do alias_matcher :be_able_to_load, :be_can_load describe "::can_load?" do diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb index dec3f37496..94e104f639 100644 --- a/Library/Homebrew/test/cask/cask_spec.rb +++ b/Library/Homebrew/test/cask/cask_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::Cask, :cask do +describe Cask::Cask, :cask do let(:cask) { described_class.new("versioned-cask") } context "when multiple versions are installed" do @@ -27,20 +27,20 @@ describe Hbc::Cask, :cask do let(:relative_tap_path) { tap_path.relative_path_from(file_dirname) } it "returns an instance of the Cask for the given token" do - c = Hbc::CaskLoader.load("local-caffeine") - expect(c).to be_kind_of(Hbc::Cask) + c = Cask::CaskLoader.load("local-caffeine") + expect(c).to be_kind_of(Cask::Cask) expect(c.token).to eq("local-caffeine") end it "returns an instance of the Cask from a specific file location" do - c = Hbc::CaskLoader.load("#{tap_path}/Casks/local-caffeine.rb") - expect(c).to be_kind_of(Hbc::Cask) + c = Cask::CaskLoader.load("#{tap_path}/Casks/local-caffeine.rb") + expect(c).to be_kind_of(Cask::Cask) expect(c.token).to eq("local-caffeine") end it "returns an instance of the Cask from a url" do - c = Hbc::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") - expect(c).to be_kind_of(Hbc::Cask) + c = Cask::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") + expect(c).to be_kind_of(Cask::Cask) expect(c.token).to eq("local-caffeine") end @@ -48,46 +48,46 @@ describe Hbc::Cask, :cask do expect { url = "file://#{tap_path}/Casks/notacask.rb" - Hbc::CaskLoader.load(url) - }.to raise_error(Hbc::CaskUnavailableError) + Cask::CaskLoader.load(url) + }.to raise_error(Cask::CaskUnavailableError) end it "returns an instance of the Cask from a relative file location" do - c = Hbc::CaskLoader.load(relative_tap_path/"Casks/local-caffeine.rb") - expect(c).to be_kind_of(Hbc::Cask) + c = Cask::CaskLoader.load(relative_tap_path/"Casks/local-caffeine.rb") + expect(c).to be_kind_of(Cask::Cask) expect(c.token).to eq("local-caffeine") end it "uses exact match when loading by token" do - expect(Hbc::CaskLoader.load("test-opera").token).to eq("test-opera") - expect(Hbc::CaskLoader.load("test-opera-mail").token).to eq("test-opera-mail") + expect(Cask::CaskLoader.load("test-opera").token).to eq("test-opera") + expect(Cask::CaskLoader.load("test-opera-mail").token).to eq("test-opera-mail") end it "raises an error when attempting to load a Cask that doesn't exist" do expect { - Hbc::CaskLoader.load("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + Cask::CaskLoader.load("notacask") + }.to raise_error(Cask::CaskUnavailableError) end end describe "metadata" do it "proposes a versioned metadata directory name for each instance" do cask_token = "local-caffeine" - c = Hbc::CaskLoader.load(cask_token) - metadata_timestamped_path = Hbc::Caskroom.path.join(cask_token, ".metadata", c.version) + c = Cask::CaskLoader.load(cask_token) + metadata_timestamped_path = Cask::Caskroom.path.join(cask_token, ".metadata", c.version) expect(c.metadata_versioned_path.to_s).to eq(metadata_timestamped_path.to_s) end end describe "outdated" do it "ignores the Casks that have auto_updates true (without --greedy)" do - c = Hbc::CaskLoader.load("auto-updates") + c = Cask::CaskLoader.load("auto-updates") expect(c).not_to be_outdated expect(c.outdated_versions).to be_empty end it "ignores the Casks that have version :latest (without --greedy)" do - c = Hbc::CaskLoader.load("version-latest-string") + c = Cask::CaskLoader.load("version-latest-string") expect(c).not_to be_outdated expect(c.outdated_versions).to be_empty end @@ -102,7 +102,7 @@ describe Hbc::Cask, :cask do context "when versions #{installed_versions.inspect} are installed and the tap version is #{tap_version}" do it { allow(cask).to receive(:versions).and_return(installed_versions) - allow(cask).to receive(:version).and_return(Hbc::DSL::Version.new(tap_version)) + allow(cask).to receive(:version).and_return(Cask::DSL::Version.new(tap_version)) expect(cask).to receive(:outdated_versions).and_call_original is_expected.to eq expected_output } @@ -136,7 +136,7 @@ describe Hbc::Cask, :cask do it { allow(cask).to receive(:versions).and_return(installed_version) - allow(cask).to receive(:version).and_return(Hbc::DSL::Version.new(tap_version)) + allow(cask).to receive(:version).and_return(Cask::DSL::Version.new(tap_version)) expect(cask).to receive(:outdated_versions).and_call_original is_expected.to eq expected_output } @@ -170,14 +170,14 @@ describe Hbc::Cask, :cask do describe "full_name" do context "when it is a core cask" do it "is the cask token" do - c = Hbc::CaskLoader.load("local-caffeine") + c = Cask::CaskLoader.load("local-caffeine") expect(c.full_name).to eq("local-caffeine") end end context "when it is from a non-core tap" do it "returns the fully-qualified name of the cask" do - c = Hbc::CaskLoader.load("third-party/tap/third-party-cask") + c = Cask::CaskLoader.load("third-party/tap/third-party-cask") expect(c.full_name).to eq("third-party/tap/third-party-cask") end end @@ -191,7 +191,7 @@ describe Hbc::Cask, :cask do file.write "cask '#{cask_name}'" file.close - c = Hbc::CaskLoader.load(file.path) + c = Cask::CaskLoader.load(file.path) expect(c.full_name).to eq(cask_name) ensure file.close diff --git a/Library/Homebrew/test/cask/cmd/audit_spec.rb b/Library/Homebrew/test/cask/cmd/audit_spec.rb index 5fc7156d44..b3b818a834 100644 --- a/Library/Homebrew/test/cask/cmd/audit_spec.rb +++ b/Library/Homebrew/test/cask/cmd/audit_spec.rb @@ -1,24 +1,24 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Audit, :cask do - let(:cask) { Hbc::Cask.new(nil) } +describe Cask::Cmd::Audit, :cask do + let(:cask) { Cask::Cask.new(nil) } it_behaves_like "a command that handles invalid options" describe "selection of Casks to audit" do it "audits all Casks if no tokens are given" do - allow(Hbc::Cask).to receive(:to_a).and_return([cask, cask]) + allow(Cask::Cask).to receive(:to_a).and_return([cask, cask]) - expect(Hbc::Auditor).to receive(:audit).twice.and_return(true) + expect(Cask::Auditor).to receive(:audit).twice.and_return(true) described_class.run end it "audits specified Casks if tokens are given" do cask_token = "nice-app" - expect(Hbc::CaskLoader).to receive(:load).with(cask_token).and_return(cask) + expect(Cask::CaskLoader).to receive(:load).with(cask_token).and_return(cask) - expect(Hbc::Auditor).to receive(:audit) + expect(Cask::Auditor).to receive(:audit) .with(cask, audit_download: false, check_token_conflicts: false, quarantine: true) .and_return(true) @@ -28,8 +28,8 @@ describe Hbc::Cmd::Audit, :cask do describe "rules for downloading a Cask" do it "does not download the Cask per default" do - allow(Hbc::CaskLoader).to receive(:load).and_return(cask) - expect(Hbc::Auditor).to receive(:audit) + allow(Cask::CaskLoader).to receive(:load).and_return(cask) + expect(Cask::Auditor).to receive(:audit) .with(cask, audit_download: false, check_token_conflicts: false, quarantine: true) .and_return(true) @@ -37,8 +37,8 @@ describe Hbc::Cmd::Audit, :cask do end it "download a Cask if --download flag is set" do - allow(Hbc::CaskLoader).to receive(:load).and_return(cask) - expect(Hbc::Auditor).to receive(:audit) + allow(Cask::CaskLoader).to receive(:load).and_return(cask) + expect(Cask::Auditor).to receive(:audit) .with(cask, audit_download: true, check_token_conflicts: false, quarantine: true) .and_return(true) @@ -48,8 +48,8 @@ describe Hbc::Cmd::Audit, :cask do describe "rules for checking token conflicts" do it "does not check for token conflicts per default" do - allow(Hbc::CaskLoader).to receive(:load).and_return(cask) - expect(Hbc::Auditor).to receive(:audit) + allow(Cask::CaskLoader).to receive(:load).and_return(cask) + expect(Cask::Auditor).to receive(:audit) .with(cask, audit_download: false, check_token_conflicts: false, quarantine: true) .and_return(true) @@ -57,8 +57,8 @@ describe Hbc::Cmd::Audit, :cask do end it "checks for token conflicts if --token-conflicts flag is set" do - allow(Hbc::CaskLoader).to receive(:load).and_return(cask) - expect(Hbc::Auditor).to receive(:audit) + allow(Cask::CaskLoader).to receive(:load).and_return(cask) + expect(Cask::Auditor).to receive(:audit) .with(cask, audit_download: false, check_token_conflicts: true, quarantine: true) .and_return(true) diff --git a/Library/Homebrew/test/cask/cmd/cat_spec.rb b/Library/Homebrew/test/cask/cmd/cat_spec.rb index 293000c93a..11a057b64c 100644 --- a/Library/Homebrew/test/cask/cmd/cat_spec.rb +++ b/Library/Homebrew/test/cask/cmd/cat_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Cat, :cask do +describe Cask::Cmd::Cat, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" @@ -35,6 +35,6 @@ describe Hbc::Cmd::Cat, :cask do it "raises an exception when the Cask does not exist" do expect { described_class.run("notacask") } - .to raise_error(Hbc::CaskUnavailableError, /is unavailable/) + .to raise_error(Cask::CaskUnavailableError, /is unavailable/) end end diff --git a/Library/Homebrew/test/cask/cmd/create_spec.rb b/Library/Homebrew/test/cask/cmd/create_spec.rb index 06a25f54fb..9a26346bb5 100644 --- a/Library/Homebrew/test/cask/cmd/create_spec.rb +++ b/Library/Homebrew/test/cask/cmd/create_spec.rb @@ -1,13 +1,13 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Create, :cask do +describe Cask::Cmd::Create, :cask do around do |example| begin example.run ensure %w[new-cask additional-cask another-cask yet-another-cask local-caff].each do |cask| - FileUtils.rm_f Hbc::CaskLoader.path(cask) + FileUtils.rm_f Cask::CaskLoader.path(cask) end end end @@ -21,13 +21,13 @@ describe Hbc::Cmd::Create, :cask do it "opens the editor for the specified Cask" do command = described_class.new("new-cask") - expect(command).to receive(:exec_editor).with(Hbc::CaskLoader.path("new-cask")) + expect(command).to receive(:exec_editor).with(Cask::CaskLoader.path("new-cask")) command.run end it "drops a template down for the specified Cask" do described_class.run("new-cask") - template = File.read(Hbc::CaskLoader.path("new-cask")) + template = File.read(Cask::CaskLoader.path("new-cask")) expect(template).to eq <<~RUBY cask 'new-cask' do version '' @@ -51,12 +51,12 @@ describe Hbc::Cmd::Create, :cask do it "raises an exception when the Cask already exists" do expect { described_class.run("basic-cask") - }.to raise_error(Hbc::CaskAlreadyCreatedError) + }.to raise_error(Cask::CaskAlreadyCreatedError) end it "allows creating Casks that are substrings of existing Casks" do command = described_class.new("local-caff") - expect(command).to receive(:exec_editor).with(Hbc::CaskLoader.path("local-caff")) + expect(command).to receive(:exec_editor).with(Cask::CaskLoader.path("local-caff")) command.run end end diff --git a/Library/Homebrew/test/cask/cmd/doctor_spec.rb b/Library/Homebrew/test/cask/cmd/doctor_spec.rb index a8f0b4261d..90aa14c930 100644 --- a/Library/Homebrew/test/cask/cmd/doctor_spec.rb +++ b/Library/Homebrew/test/cask/cmd/doctor_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Doctor, :cask do +describe Cask::Cmd::Doctor, :cask do it_behaves_like "a command that handles invalid options" it "displays some nice info about the environment" do diff --git a/Library/Homebrew/test/cask/cmd/edit_spec.rb b/Library/Homebrew/test/cask/cmd/edit_spec.rb index 91c67fb9b2..2d5f2a9a1a 100644 --- a/Library/Homebrew/test/cask/cmd/edit_spec.rb +++ b/Library/Homebrew/test/cask/cmd/edit_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Edit, :cask do +describe Cask::Cmd::Edit, :cask do before do allow_any_instance_of(described_class).to receive(:exec_editor) end @@ -11,7 +11,7 @@ describe Hbc::Cmd::Edit, :cask do it "opens the editor for the specified Cask" do command = described_class.new("local-caffeine") - expect(command).to receive(:exec_editor).with(Hbc::CaskLoader.path("local-caffeine")) + expect(command).to receive(:exec_editor).with(Cask::CaskLoader.path("local-caffeine")) command.run end @@ -24,6 +24,6 @@ describe Hbc::Cmd::Edit, :cask do it "raises an exception when the Cask doesnt exist" do expect { described_class.run("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + }.to raise_error(Cask::CaskUnavailableError) end end diff --git a/Library/Homebrew/test/cask/cmd/fetch_spec.rb b/Library/Homebrew/test/cask/cmd/fetch_spec.rb index 51ba3329b7..449de9d8ba 100644 --- a/Library/Homebrew/test/cask/cmd/fetch_spec.rb +++ b/Library/Homebrew/test/cask/cmd/fetch_spec.rb @@ -1,13 +1,13 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Fetch, :cask do +describe Cask::Cmd::Fetch, :cask do let(:local_transmission) { - Hbc::CaskLoader.load(cask_path("local-transmission")) + Cask::CaskLoader.load(cask_path("local-transmission")) } let(:local_caffeine) { - Hbc::CaskLoader.load(cask_path("local-caffeine")) + Cask::CaskLoader.load(cask_path("local-caffeine")) } it_behaves_like "a command that requires a Cask token" @@ -16,11 +16,11 @@ describe Hbc::Cmd::Fetch, :cask do it "allows downloading the installer of a Cask" do transmission_location = CurlDownloadStrategy.new( local_transmission.url.to_s, local_transmission.token, local_transmission.version, - cache: Hbc::Cache.path, **local_transmission.url.specs + cache: Cask::Cache.path, **local_transmission.url.specs ).cached_location caffeine_location = CurlDownloadStrategy.new( local_caffeine.url.to_s, local_caffeine.token, local_caffeine.version, - cache: Hbc::Cache.path, **local_caffeine.url.specs + cache: Cask::Cache.path, **local_caffeine.url.specs ).cached_location expect(transmission_location).not_to exist @@ -33,7 +33,7 @@ describe Hbc::Cmd::Fetch, :cask do end it "prevents double fetch (without nuking existing installation)" do - cached_location = Hbc::Download.new(local_transmission).perform + cached_location = Cask::Download.new(local_transmission).perform old_ctime = File.stat(cached_location).ctime @@ -44,7 +44,7 @@ describe Hbc::Cmd::Fetch, :cask do end it "allows double fetch with --force" do - cached_location = Hbc::Download.new(local_transmission).perform + cached_location = Cask::Download.new(local_transmission).perform old_ctime = File.stat(cached_location).ctime sleep(1) @@ -58,6 +58,6 @@ describe Hbc::Cmd::Fetch, :cask do it "properly handles Casks that are not present" do expect { described_class.run("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + }.to raise_error(Cask::CaskUnavailableError) end end diff --git a/Library/Homebrew/test/cask/cmd/home_spec.rb b/Library/Homebrew/test/cask/cmd/home_spec.rb index 719b73ae75..563d829d12 100644 --- a/Library/Homebrew/test/cask/cmd/home_spec.rb +++ b/Library/Homebrew/test/cask/cmd/home_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Home, :cask do +describe Cask::Cmd::Home, :cask do before do allow(described_class).to receive(:open_url) end diff --git a/Library/Homebrew/test/cask/cmd/info_spec.rb b/Library/Homebrew/test/cask/cmd/info_spec.rb index 14110f34ee..2440df4b4a 100644 --- a/Library/Homebrew/test/cask/cmd/info_spec.rb +++ b/Library/Homebrew/test/cask/cmd/info_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Info, :cask do +describe Cask::Cmd::Info, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cmd/install_spec.rb b/Library/Homebrew/test/cask/cmd/install_spec.rb index fb0153ebcb..c3113e1662 100644 --- a/Library/Homebrew/test/cask/cmd/install_spec.rb +++ b/Library/Homebrew/test/cask/cmd/install_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Install, :cask do +describe Cask::Cmd::Install, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" @@ -22,16 +22,16 @@ describe Hbc::Cmd::Install, :cask do it "allows staging and activation of multiple Casks at once" do described_class.run("local-transmission", "local-caffeine") - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed - expect(Hbc::Config.global.appdir.join("Transmission.app")).to be_a_directory - expect(Hbc::CaskLoader.load(cask_path("local-caffeine"))).to be_installed - expect(Hbc::Config.global.appdir.join("Caffeine.app")).to be_a_directory + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed + expect(Cask::Config.global.appdir.join("Transmission.app")).to be_a_directory + expect(Cask::CaskLoader.load(cask_path("local-caffeine"))).to be_installed + expect(Cask::Config.global.appdir.join("Caffeine.app")).to be_a_directory end it "skips double install (without nuking existing installation)" do described_class.run("local-transmission") described_class.run("local-transmission") - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed end it "prints a warning message on double install" do @@ -54,22 +54,22 @@ describe Hbc::Cmd::Install, :cask do it "skips dependencies with --skip-cask-deps" do described_class.run("with-depends-on-cask-multiple", "--skip-cask-deps") - expect(Hbc::CaskLoader.load(cask_path("with-depends-on-cask-multiple"))).to be_installed - expect(Hbc::CaskLoader.load(cask_path("local-caffeine"))).not_to be_installed - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).not_to be_installed + expect(Cask::CaskLoader.load(cask_path("with-depends-on-cask-multiple"))).to be_installed + expect(Cask::CaskLoader.load(cask_path("local-caffeine"))).not_to be_installed + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).not_to be_installed end it "properly handles Casks that are not present" do expect { described_class.run("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + }.to raise_error(Cask::CaskUnavailableError) end it "returns a suggestion for a misspelled Cask" do expect { described_class.run("localcaffeine") }.to raise_error( - Hbc::CaskUnavailableError, + Cask::CaskUnavailableError, "Cask 'localcaffeine' is unavailable: No Cask with this name exists. "\ "Did you mean “local-caffeine”?", ) @@ -79,7 +79,7 @@ describe Hbc::Cmd::Install, :cask do expect { described_class.run("local") }.to raise_error( - Hbc::CaskUnavailableError, + Cask::CaskUnavailableError, "Cask 'local' is unavailable: No Cask with this name exists. " \ "Did you mean one of these?\nlocal-caffeine\nlocal-transmission\n", ) diff --git a/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb b/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb index 04c3ceb7b2..b7255debd7 100644 --- a/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb +++ b/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::Cmd::InternalStanza, :cask do +describe Cask::Cmd::InternalStanza, :cask do it "shows stanza of the Specified Cask" do command = described_class.new("homepage", "local-caffeine") expect { diff --git a/Library/Homebrew/test/cask/cmd/list_spec.rb b/Library/Homebrew/test/cask/cmd/list_spec.rb index 28dbd59bee..2c819fcb30 100644 --- a/Library/Homebrew/test/cask/cmd/list_spec.rb +++ b/Library/Homebrew/test/cask/cmd/list_spec.rb @@ -1,10 +1,10 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::List, :cask do +describe Cask::Cmd::List, :cask do it_behaves_like "a command that handles invalid options" it "lists the installed Casks in a pretty fashion" do - casks = %w[local-caffeine local-transmission].map { |c| Hbc::CaskLoader.load(c) } + casks = %w[local-caffeine local-transmission].map { |c| Cask::CaskLoader.load(c) } casks.each do |c| InstallHelper.install_with_caskfile(c) @@ -23,7 +23,7 @@ describe Hbc::Cmd::List, :cask do local-caffeine third-party/tap/third-party-cask local-transmission - ].map { |c| Hbc::CaskLoader.load(c) } + ].map { |c| Cask::CaskLoader.load(c) } casks.each do |c| InstallHelper.install_with_caskfile(c) @@ -48,7 +48,7 @@ describe Hbc::Cmd::List, :cask do } before do - casks.map(&Hbc::CaskLoader.method(:load)).each(&InstallHelper.method(:install_with_caskfile)) + casks.map(&Cask::CaskLoader.method(:load)).each(&InstallHelper.method(:install_with_caskfile)) end it "of all installed Casks" do @@ -65,14 +65,14 @@ describe Hbc::Cmd::List, :cask do end describe "given a set of installed Casks" do - let(:caffeine) { Hbc::CaskLoader.load(cask_path("local-caffeine")) } - let(:transmission) { Hbc::CaskLoader.load(cask_path("local-transmission")) } + let(:caffeine) { Cask::CaskLoader.load(cask_path("local-caffeine")) } + let(:transmission) { Cask::CaskLoader.load(cask_path("local-transmission")) } let(:casks) { [caffeine, transmission] } it "lists the installed files for those Casks" do casks.each(&InstallHelper.method(:install_without_artifacts_with_caskfile)) - transmission.artifacts.select { |a| a.is_a?(Hbc::Artifact::App) }.each do |artifact| + transmission.artifacts.select { |a| a.is_a?(Cask::Artifact::App) }.each do |artifact| artifact.install_phase(command: NeverSudoSystemCommand, force: false) end @@ -80,9 +80,9 @@ describe Hbc::Cmd::List, :cask do described_class.run("local-transmission", "local-caffeine") }.to output(<<~EOS).to_stdout ==> Apps - #{Hbc::Config.global.appdir.join("Transmission.app")} (#{Hbc::Config.global.appdir.join("Transmission.app").abv}) + #{Cask::Config.global.appdir.join("Transmission.app")} (#{Cask::Config.global.appdir.join("Transmission.app").abv}) ==> Apps - Missing App: #{Hbc::Config.global.appdir.join("Caffeine.app")} + Missing App: #{Cask::Config.global.appdir.join("Caffeine.app")} EOS end end diff --git a/Library/Homebrew/test/cask/cmd/options_spec.rb b/Library/Homebrew/test/cask/cmd/options_spec.rb index da686cc073..ec565b57fc 100644 --- a/Library/Homebrew/test/cask/cmd/options_spec.rb +++ b/Library/Homebrew/test/cask/cmd/options_spec.rb @@ -1,136 +1,136 @@ -describe Hbc::Cmd, :cask do +describe Cask::Cmd, :cask do it "supports setting the appdir" do - allow(Hbc::Config.global).to receive(:appdir).and_call_original + allow(Cask::Config.global).to receive(:appdir).and_call_original described_class.new.process_options("help", "--appdir=/some/path/foo") - expect(Hbc::Config.global.appdir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.appdir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the appdir from ENV" do - allow(Hbc::Config.global).to receive(:appdir).and_call_original + allow(Cask::Config.global).to receive(:appdir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--appdir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.appdir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.appdir).to eq(Pathname.new("/some/path/bar")) end it "supports setting the prefpanedir" do - allow(Hbc::Config.global).to receive(:prefpanedir).and_call_original + allow(Cask::Config.global).to receive(:prefpanedir).and_call_original described_class.new.process_options("help", "--prefpanedir=/some/path/foo") - expect(Hbc::Config.global.prefpanedir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.prefpanedir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the prefpanedir from ENV" do - allow(Hbc::Config.global).to receive(:prefpanedir).and_call_original + allow(Cask::Config.global).to receive(:prefpanedir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--prefpanedir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.prefpanedir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.prefpanedir).to eq(Pathname.new("/some/path/bar")) end it "supports setting the qlplugindir" do - allow(Hbc::Config.global).to receive(:qlplugindir).and_call_original + allow(Cask::Config.global).to receive(:qlplugindir).and_call_original described_class.new.process_options("help", "--qlplugindir=/some/path/foo") - expect(Hbc::Config.global.qlplugindir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.qlplugindir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the qlplugindir from ENV" do - allow(Hbc::Config.global).to receive(:qlplugindir).and_call_original + allow(Cask::Config.global).to receive(:qlplugindir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--qlplugindir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.qlplugindir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.qlplugindir).to eq(Pathname.new("/some/path/bar")) end it "supports setting the colorpickerdir" do - allow(Hbc::Config.global).to receive(:colorpickerdir).and_call_original + allow(Cask::Config.global).to receive(:colorpickerdir).and_call_original described_class.new.process_options("help", "--colorpickerdir=/some/path/foo") - expect(Hbc::Config.global.colorpickerdir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.colorpickerdir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the colorpickerdir from ENV" do - allow(Hbc::Config.global).to receive(:colorpickerdir).and_call_original + allow(Cask::Config.global).to receive(:colorpickerdir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--colorpickerdir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.colorpickerdir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.colorpickerdir).to eq(Pathname.new("/some/path/bar")) end it "supports setting the dictionarydir" do - allow(Hbc::Config.global).to receive(:dictionarydir).and_call_original + allow(Cask::Config.global).to receive(:dictionarydir).and_call_original described_class.new.process_options("help", "--dictionarydir=/some/path/foo") - expect(Hbc::Config.global.dictionarydir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.dictionarydir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the dictionarydir from ENV" do - allow(Hbc::Config.global).to receive(:dictionarydir).and_call_original + allow(Cask::Config.global).to receive(:dictionarydir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--dictionarydir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.dictionarydir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.dictionarydir).to eq(Pathname.new("/some/path/bar")) end it "supports setting the fontdir" do - allow(Hbc::Config.global).to receive(:fontdir).and_call_original + allow(Cask::Config.global).to receive(:fontdir).and_call_original described_class.new.process_options("help", "--fontdir=/some/path/foo") - expect(Hbc::Config.global.fontdir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.fontdir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the fontdir from ENV" do - allow(Hbc::Config.global).to receive(:fontdir).and_call_original + allow(Cask::Config.global).to receive(:fontdir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--fontdir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.fontdir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.fontdir).to eq(Pathname.new("/some/path/bar")) end it "supports setting the servicedir" do - allow(Hbc::Config.global).to receive(:servicedir).and_call_original + allow(Cask::Config.global).to receive(:servicedir).and_call_original described_class.new.process_options("help", "--servicedir=/some/path/foo") - expect(Hbc::Config.global.servicedir).to eq(Pathname.new("/some/path/foo")) + expect(Cask::Config.global.servicedir).to eq(Pathname.new("/some/path/foo")) end it "supports setting the servicedir from ENV" do - allow(Hbc::Config.global).to receive(:servicedir).and_call_original + allow(Cask::Config.global).to receive(:servicedir).and_call_original ENV["HOMEBREW_CASK_OPTS"] = "--servicedir=/some/path/bar" described_class.new.process_options("help") - expect(Hbc::Config.global.servicedir).to eq(Pathname.new("/some/path/bar")) + expect(Cask::Config.global.servicedir).to eq(Pathname.new("/some/path/bar")) end it "allows additional options to be passed through" do - allow(Hbc::Config.global).to receive(:appdir).and_call_original + allow(Cask::Config.global).to receive(:appdir).and_call_original rest = described_class.new.process_options("edit", "foo", "--create", "--appdir=/some/path/qux") - expect(Hbc::Config.global.appdir).to eq(Pathname.new("/some/path/qux")) + expect(Cask::Config.global.appdir).to eq(Pathname.new("/some/path/qux")) expect(rest).to eq(%w[edit foo --create]) end diff --git a/Library/Homebrew/test/cask/cmd/outdated_spec.rb b/Library/Homebrew/test/cask/cmd/outdated_spec.rb index 328dbb7048..23f2044624 100644 --- a/Library/Homebrew/test/cask/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cask/cmd/outdated_spec.rb @@ -1,13 +1,13 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Outdated, :cask do +describe Cask::Cmd::Outdated, :cask do let(:installed) do [ - Hbc::CaskLoader.load(cask_path("basic-cask")), - Hbc::CaskLoader.load(cask_path("outdated/local-caffeine")), - Hbc::CaskLoader.load(cask_path("outdated/local-transmission")), - Hbc::CaskLoader.load(cask_path("version-latest-string")), - Hbc::CaskLoader.load(cask_path("outdated/auto-updates")), + Cask::CaskLoader.load(cask_path("basic-cask")), + Cask::CaskLoader.load(cask_path("outdated/local-caffeine")), + Cask::CaskLoader.load(cask_path("outdated/local-transmission")), + Cask::CaskLoader.load(cask_path("version-latest-string")), + Cask::CaskLoader.load(cask_path("outdated/auto-updates")), ] end @@ -74,7 +74,7 @@ describe Hbc::Cmd::Outdated, :cask do end it 'does not include the Casks with "auto_updates true" when the version did not change' do - cask = Hbc::CaskLoader.load(cask_path("auto-updates")) + cask = Cask::CaskLoader.load(cask_path("auto-updates")) InstallHelper.install_with_caskfile(cask) expect { diff --git a/Library/Homebrew/test/cask/cmd/quarantine_spec.rb b/Library/Homebrew/test/cask/cmd/quarantine_spec.rb index cd4a9a3795..87b3bcdffc 100644 --- a/Library/Homebrew/test/cask/cmd/quarantine_spec.rb +++ b/Library/Homebrew/test/cask/cmd/quarantine_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::Quarantine, :cask do +describe Cask::Quarantine, :cask do matcher :be_quarantined do match do |path| expect( @@ -9,203 +9,203 @@ describe Hbc::Quarantine, :cask do describe "by default" do it "quarantines a nice fresh Cask" do - Hbc::Cmd::Install.run("local-transmission") + Cask::Cmd::Install.run("local-transmission") expect( - Hbc::CaskLoader.load(cask_path("local-transmission")), + Cask::CaskLoader.load(cask_path("local-transmission")), ).to be_installed expect( - Hbc::Config.global.appdir.join("Transmission.app"), + Cask::Config.global.appdir.join("Transmission.app"), ).to be_quarantined end it "quarantines Cask fetches" do - Hbc::Cmd::Fetch.run("local-transmission") - local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) - cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform + Cask::Cmd::Fetch.run("local-transmission") + local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) + cached_location = Cask::Download.new(local_transmission, force: false, quarantine: false).perform expect(cached_location).to be_quarantined end it "quarantines Cask audits" do - Hbc::Cmd::Audit.run("local-transmission", "--download") + Cask::Cmd::Audit.run("local-transmission", "--download") - local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) - cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform + local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) + cached_location = Cask::Download.new(local_transmission, force: false, quarantine: false).perform expect(cached_location).to be_quarantined end it "quarantines dmg-based Casks" do - Hbc::Cmd::Install.run("container-dmg") + Cask::Cmd::Install.run("container-dmg") expect( - Hbc::CaskLoader.load(cask_path("container-dmg")), + Cask::CaskLoader.load(cask_path("container-dmg")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to be_quarantined + expect(Cask::Config.global.appdir.join("container")).to be_quarantined end it "quarantines tar-gz-based Casks" do - Hbc::Cmd::Install.run("container-tar-gz") + Cask::Cmd::Install.run("container-tar-gz") expect( - Hbc::CaskLoader.load(cask_path("container-tar-gz")), + Cask::CaskLoader.load(cask_path("container-tar-gz")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to be_quarantined + expect(Cask::Config.global.appdir.join("container")).to be_quarantined end it "quarantines xar-based Casks" do - Hbc::Cmd::Install.run("container-xar") + Cask::Cmd::Install.run("container-xar") expect( - Hbc::CaskLoader.load(cask_path("container-xar")), + Cask::CaskLoader.load(cask_path("container-xar")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to be_quarantined + expect(Cask::Config.global.appdir.join("container")).to be_quarantined end it "quarantines pure bzip2-based Casks" do - Hbc::Cmd::Install.run("container-bzip2") + Cask::Cmd::Install.run("container-bzip2") expect( - Hbc::CaskLoader.load(cask_path("container-bzip2")), + Cask::CaskLoader.load(cask_path("container-bzip2")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to be_quarantined + expect(Cask::Config.global.appdir.join("container")).to be_quarantined end it "quarantines pure gzip-based Casks" do - Hbc::Cmd::Install.run("container-gzip") + Cask::Cmd::Install.run("container-gzip") expect( - Hbc::CaskLoader.load(cask_path("container-gzip")), + Cask::CaskLoader.load(cask_path("container-gzip")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to be_quarantined + expect(Cask::Config.global.appdir.join("container")).to be_quarantined end it "quarantines the pkg in naked-pkg-based Casks" do - Hbc::Cmd::Install.run("container-pkg") + Cask::Cmd::Install.run("container-pkg") - naked_pkg = Hbc::CaskLoader.load(cask_path("container-pkg")) + naked_pkg = Cask::CaskLoader.load(cask_path("container-pkg")) expect(naked_pkg).to be_installed expect( - Hbc::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg"), + Cask::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg"), ).to be_quarantined end it "quarantines a nested container" do - Hbc::Cmd::Install.run("nested-app") + Cask::Cmd::Install.run("nested-app") expect( - Hbc::CaskLoader.load(cask_path("nested-app")), + Cask::CaskLoader.load(cask_path("nested-app")), ).to be_installed - expect(Hbc::Config.global.appdir.join("MyNestedApp.app")).to be_quarantined + expect(Cask::Config.global.appdir.join("MyNestedApp.app")).to be_quarantined end end describe "when disabled" do it "does not quarantine even a nice, fresh Cask" do - Hbc::Cmd::Install.run("local-transmission", "--no-quarantine") + Cask::Cmd::Install.run("local-transmission", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("local-transmission")), + Cask::CaskLoader.load(cask_path("local-transmission")), ).to be_installed - expect(Hbc::Config.global.appdir.join("Transmission.app")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("Transmission.app")).to_not be_quarantined end it "does not quarantine Cask fetches" do - Hbc::Cmd::Fetch.run("local-transmission", "--no-quarantine") - local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) - cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform + Cask::Cmd::Fetch.run("local-transmission", "--no-quarantine") + local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) + cached_location = Cask::Download.new(local_transmission, force: false, quarantine: false).perform expect(cached_location).to_not be_quarantined end it "does not quarantine dmg-based Casks" do - Hbc::Cmd::Install.run("container-dmg", "--no-quarantine") + Cask::Cmd::Install.run("container-dmg", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("container-dmg")), + Cask::CaskLoader.load(cask_path("container-dmg")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("container")).to_not be_quarantined end it "does not quarantine tar-gz-based Casks" do - Hbc::Cmd::Install.run("container-tar-gz", "--no-quarantine") + Cask::Cmd::Install.run("container-tar-gz", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("container-tar-gz")), + Cask::CaskLoader.load(cask_path("container-tar-gz")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("container")).to_not be_quarantined end it "does not quarantine xar-based Casks" do - Hbc::Cmd::Install.run("container-xar", "--no-quarantine") + Cask::Cmd::Install.run("container-xar", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("container-xar")), + Cask::CaskLoader.load(cask_path("container-xar")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("container")).to_not be_quarantined end it "does not quarantine pure bzip2-based Casks" do - Hbc::Cmd::Install.run("container-bzip2", "--no-quarantine") + Cask::Cmd::Install.run("container-bzip2", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("container-bzip2")), + Cask::CaskLoader.load(cask_path("container-bzip2")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("container")).to_not be_quarantined end it "does not quarantine pure gzip-based Casks" do - Hbc::Cmd::Install.run("container-gzip", "--no-quarantine") + Cask::Cmd::Install.run("container-gzip", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("container-gzip")), + Cask::CaskLoader.load(cask_path("container-gzip")), ).to be_installed - expect(Hbc::Config.global.appdir.join("container")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("container")).to_not be_quarantined end it "does not quarantine the pkg in naked-pkg-based Casks" do - Hbc::Cmd::Install.run("container-pkg", "--no-quarantine") + Cask::Cmd::Install.run("container-pkg", "--no-quarantine") - naked_pkg = Hbc::CaskLoader.load(cask_path("container-pkg")) + naked_pkg = Cask::CaskLoader.load(cask_path("container-pkg")) expect(naked_pkg).to be_installed expect( - Hbc::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg"), + Cask::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg"), ).to_not be_quarantined end it "does not quarantine a nested container" do - Hbc::Cmd::Install.run("nested-app", "--no-quarantine") + Cask::Cmd::Install.run("nested-app", "--no-quarantine") expect( - Hbc::CaskLoader.load(cask_path("nested-app")), + Cask::CaskLoader.load(cask_path("nested-app")), ).to be_installed - expect(Hbc::Config.global.appdir.join("MyNestedApp.app")).to_not be_quarantined + expect(Cask::Config.global.appdir.join("MyNestedApp.app")).to_not be_quarantined end it "does not quarantine Cask audits" do - Hbc::Cmd::Audit.run("local-transmission", "--download", "--no-quarantine") + Cask::Cmd::Audit.run("local-transmission", "--download", "--no-quarantine") - local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) - cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform + local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) + cached_location = Cask::Download.new(local_transmission, force: false, quarantine: false).perform expect(cached_location).to_not be_quarantined end diff --git a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb index 6bac52021e..e011e35b6c 100644 --- a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb @@ -1,12 +1,12 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Reinstall, :cask do +describe Cask::Cmd::Reinstall, :cask do it_behaves_like "a command that handles invalid options" it "displays the reinstallation progress" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) - Hbc::Installer.new(caffeine).install + Cask::Installer.new(caffeine).install output = Regexp.new <<~EOS ==> Downloading file:.*caffeine.zip @@ -22,23 +22,23 @@ describe Hbc::Cmd::Reinstall, :cask do EOS expect { - Hbc::Cmd::Reinstall.run("local-caffeine") + Cask::Cmd::Reinstall.run("local-caffeine") }.to output(output).to_stdout end it "allows reinstalling a Cask" do - Hbc::Cmd::Install.run("local-transmission") + Cask::Cmd::Install.run("local-transmission") - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed - Hbc::Cmd::Reinstall.run("local-transmission") - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed + Cask::Cmd::Reinstall.run("local-transmission") + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed end it "allows reinstalling a non installed Cask" do - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).not_to be_installed + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).not_to be_installed - Hbc::Cmd::Reinstall.run("local-transmission") - expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed + Cask::Cmd::Reinstall.run("local-transmission") + expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed end end diff --git a/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb b/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb index dc1e471e5a..8361270fbf 100644 --- a/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb +++ b/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb @@ -3,7 +3,7 @@ shared_examples "a command that requires a Cask token" do it "raises an exception " do expect { described_class.run - }.to raise_error(Hbc::CaskUnspecifiedError, "This command requires a Cask token.") + }.to raise_error(Cask::CaskUnspecifiedError, "This command requires a Cask token.") end end end diff --git a/Library/Homebrew/test/cask/cmd/style_spec.rb b/Library/Homebrew/test/cask/cmd/style_spec.rb index 8194ff4ebb..835dc29f2e 100644 --- a/Library/Homebrew/test/cask/cmd/style_spec.rb +++ b/Library/Homebrew/test/cask/cmd/style_spec.rb @@ -3,7 +3,7 @@ require "rubygems" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Style, :cask do +describe Cask::Cmd::Style, :cask do let(:args) { [] } let(:cli) { described_class.new(*args) } @@ -32,7 +32,7 @@ describe Hbc::Cmd::Style, :cask do let(:success) { false } it "raises an error" do - expect { subject }.to raise_error(Hbc::CaskError) + expect { subject }.to raise_error(Cask::CaskError) end end end @@ -56,7 +56,7 @@ describe Hbc::Cmd::Style, :cask do end it "raises an error" do - expect { subject }.to raise_error(Hbc::CaskError) + expect { subject }.to raise_error(Cask::CaskError) end end @@ -118,7 +118,7 @@ describe Hbc::Cmd::Style, :cask do end it "tries to find paths for all tokens" do - expect(Hbc::CaskLoader).to receive(:load).twice.and_return(double("cask", sourcefile_path: nil)) + expect(Cask::CaskLoader).to receive(:load).twice.and_return(double("cask", sourcefile_path: nil)) subject end end diff --git a/Library/Homebrew/test/cask/cmd/uninstall_spec.rb b/Library/Homebrew/test/cask/cmd/uninstall_spec.rb index 5fea31a2d5..215c9f9757 100644 --- a/Library/Homebrew/test/cask/cmd/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/uninstall_spec.rb @@ -1,14 +1,14 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Uninstall, :cask do +describe Cask::Cmd::Uninstall, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" it "displays the uninstallation progress" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) - Hbc::Installer.new(caffeine).install + Cask::Installer.new(caffeine).install output = Regexp.new <<~EOS ==> Uninstalling Cask local-caffeine @@ -24,12 +24,12 @@ describe Hbc::Cmd::Uninstall, :cask do it "shows an error when a bad Cask is provided" do expect { described_class.run("notacask") } - .to raise_error(Hbc::CaskUnavailableError, /is unavailable/) + .to raise_error(Cask::CaskUnavailableError, /is unavailable/) end it "shows an error when a Cask is provided that's not installed" do expect { described_class.run("local-caffeine") } - .to raise_error(Hbc::CaskNotInstalledError, /is not installed/) + .to raise_error(Cask::CaskNotInstalledError, /is not installed/) end it "tries anyway on a non-present Cask when --force is given" do @@ -39,11 +39,11 @@ describe Hbc::Cmd::Uninstall, :cask do end it "can uninstall and unlink multiple Casks at once" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) - transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) + transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - Hbc::Installer.new(caffeine).install - Hbc::Installer.new(transmission).install + Cask::Installer.new(caffeine).install + Cask::Installer.new(transmission).install expect(caffeine).to be_installed expect(transmission).to be_installed @@ -51,38 +51,38 @@ describe Hbc::Cmd::Uninstall, :cask do described_class.run("local-caffeine", "local-transmission") expect(caffeine).not_to be_installed - expect(Hbc::Config.global.appdir.join("Transmission.app")).not_to exist + expect(Cask::Config.global.appdir.join("Transmission.app")).not_to exist expect(transmission).not_to be_installed - expect(Hbc::Config.global.appdir.join("Caffeine.app")).not_to exist + expect(Cask::Config.global.appdir.join("Caffeine.app")).not_to exist end it "calls `uninstall` before removing artifacts" do - cask = Hbc::CaskLoader.load(cask_path("with-uninstall-script-app")) + cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app")) - Hbc::Installer.new(cask).install + Cask::Installer.new(cask).install expect(cask).to be_installed - expect(Hbc::Config.global.appdir.join("MyFancyApp.app")).to exist + expect(Cask::Config.global.appdir.join("MyFancyApp.app")).to exist expect { described_class.run("with-uninstall-script-app") }.not_to raise_error expect(cask).not_to be_installed - expect(Hbc::Config.global.appdir.join("MyFancyApp.app")).not_to exist + expect(Cask::Config.global.appdir.join("MyFancyApp.app")).not_to exist end it "can uninstall Casks when the uninstall script is missing, but only when using `--force`" do - cask = Hbc::CaskLoader.load(cask_path("with-uninstall-script-app")) + cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app")) - Hbc::Installer.new(cask).install + Cask::Installer.new(cask).install expect(cask).to be_installed - Hbc::Config.global.appdir.join("MyFancyApp.app").rmtree + Cask::Config.global.appdir.join("MyFancyApp.app").rmtree expect { described_class.run("with-uninstall-script-app") } - .to raise_error(Hbc::CaskError, /uninstall script .* does not exist/) + .to raise_error(Cask::CaskError, /uninstall script .* does not exist/) expect(cask).to be_installed @@ -103,7 +103,7 @@ describe Hbc::Cmd::Uninstall, :cask do [last_installed_version, "456000"], ] } - let(:caskroom_path) { Hbc::Caskroom.path.join(token).tap(&:mkpath) } + let(:caskroom_path) { Cask::Caskroom.path.join(token).tap(&:mkpath) } before do timestamped_versions.each do |timestamped_version| @@ -142,8 +142,8 @@ describe Hbc::Cmd::Uninstall, :cask do end describe "when Casks in Taps have been renamed or removed" do - let(:app) { Hbc::Config.global.appdir.join("ive-been-renamed.app") } - let(:caskroom_path) { Hbc::Caskroom.path.join("ive-been-renamed").tap(&:mkpath) } + let(:app) { Cask::Config.global.appdir.join("ive-been-renamed.app") } + let(:caskroom_path) { Cask::Caskroom.path.join("ive-been-renamed").tap(&:mkpath) } let(:saved_caskfile) { caskroom_path.join(".metadata", "latest", "timestamp", "Casks").join("ive-been-renamed.rb") } diff --git a/Library/Homebrew/test/cask/cmd/upgrade_spec.rb b/Library/Homebrew/test/cask/cmd/upgrade_spec.rb index f1afd54718..b43bb6c9fa 100644 --- a/Library/Homebrew/test/cask/cmd/upgrade_spec.rb +++ b/Library/Homebrew/test/cask/cmd/upgrade_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Upgrade, :cask do +describe Cask::Cmd::Upgrade, :cask do it_behaves_like "a command that handles invalid options" context "successful upgrade" do @@ -14,17 +14,17 @@ describe Hbc::Cmd::Upgrade, :cask do } before do - installed.each { |cask| Hbc::Cmd::Install.run(cask) } + installed.each { |cask| Cask::Cmd::Install.run(cask) } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end describe 'without --greedy it ignores the Casks with "version latest" or "auto_updates true"' do it "updates all the installed Casks when no token is provided" do - local_caffeine = Hbc::CaskLoader.load("local-caffeine") - local_caffeine_path = Hbc::Config.global.appdir.join("Caffeine.app") - local_transmission = Hbc::CaskLoader.load("local-transmission") - local_transmission_path = Hbc::Config.global.appdir.join("Transmission.app") + local_caffeine = Cask::CaskLoader.load("local-caffeine") + local_caffeine_path = Cask::Config.global.appdir.join("Caffeine.app") + local_transmission = Cask::CaskLoader.load("local-transmission") + local_transmission_path = Cask::Config.global.appdir.join("Transmission.app") expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -46,10 +46,10 @@ describe Hbc::Cmd::Upgrade, :cask do end it "updates only the Casks specified in the command line" do - local_caffeine = Hbc::CaskLoader.load("local-caffeine") - local_caffeine_path = Hbc::Config.global.appdir.join("Caffeine.app") - local_transmission = Hbc::CaskLoader.load("local-transmission") - local_transmission_path = Hbc::Config.global.appdir.join("Transmission.app") + local_caffeine = Cask::CaskLoader.load("local-caffeine") + local_caffeine_path = Cask::Config.global.appdir.join("Caffeine.app") + local_transmission = Cask::CaskLoader.load("local-transmission") + local_transmission_path = Cask::Config.global.appdir.join("Transmission.app") expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -71,10 +71,10 @@ describe Hbc::Cmd::Upgrade, :cask do end it 'updates "auto_updates" and "latest" Casks when their tokens are provided in the command line' do - local_caffeine = Hbc::CaskLoader.load("local-caffeine") - local_caffeine_path = Hbc::Config.global.appdir.join("Caffeine.app") - auto_updates = Hbc::CaskLoader.load("auto-updates") - auto_updates_path = Hbc::Config.global.appdir.join("MyFancyApp.app") + local_caffeine = Cask::CaskLoader.load("local-caffeine") + local_caffeine_path = Cask::Config.global.appdir.join("Caffeine.app") + auto_updates = Cask::CaskLoader.load("auto-updates") + auto_updates_path = Cask::Config.global.appdir.join("MyFancyApp.app") expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -98,15 +98,15 @@ describe Hbc::Cmd::Upgrade, :cask do describe "with --greedy it checks additional Casks" do it 'includes the Casks with "auto_updates true" or "version latest"' do - local_caffeine = Hbc::CaskLoader.load("local-caffeine") - local_caffeine_path = Hbc::Config.global.appdir.join("Caffeine.app") - auto_updates = Hbc::CaskLoader.load("auto-updates") - auto_updates_path = Hbc::Config.global.appdir.join("MyFancyApp.app") - local_transmission = Hbc::CaskLoader.load("local-transmission") - local_transmission_path = Hbc::Config.global.appdir.join("Transmission.app") - version_latest = Hbc::CaskLoader.load("version-latest") - version_latest_path_1 = Hbc::Config.global.appdir.join("Caffeine Mini.app") - version_latest_path_2 = Hbc::Config.global.appdir.join("Caffeine Pro.app") + local_caffeine = Cask::CaskLoader.load("local-caffeine") + local_caffeine_path = Cask::Config.global.appdir.join("Caffeine.app") + auto_updates = Cask::CaskLoader.load("auto-updates") + auto_updates_path = Cask::Config.global.appdir.join("MyFancyApp.app") + local_transmission = Cask::CaskLoader.load("local-transmission") + local_transmission_path = Cask::Config.global.appdir.join("Transmission.app") + version_latest = Cask::CaskLoader.load("version-latest") + version_latest_path_1 = Cask::Config.global.appdir.join("Caffeine Mini.app") + version_latest_path_2 = Cask::Config.global.appdir.join("Caffeine Pro.app") expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -146,8 +146,8 @@ describe Hbc::Cmd::Upgrade, :cask do end it 'does not include the Casks with "auto_updates true" when the version did not change' do - cask = Hbc::CaskLoader.load("auto-updates") - cask_path = Hbc::Config.global.appdir.join("MyFancyApp.app") + cask = Cask::CaskLoader.load("auto-updates") + cask_path = Cask::Config.global.appdir.join("MyFancyApp.app") expect(cask).to be_installed expect(cask_path).to be_a_directory @@ -177,7 +177,7 @@ describe Hbc::Cmd::Upgrade, :cask do } before do - installed.each { |cask| Hbc::Cmd::Install.run(cask) } + installed.each { |cask| Cask::Cmd::Install.run(cask) } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end @@ -187,8 +187,8 @@ describe Hbc::Cmd::Upgrade, :cask do EOS it "restores the old Cask if the upgrade failed" do - will_fail_if_upgraded = Hbc::CaskLoader.load("will-fail-if-upgraded") - will_fail_if_upgraded_path = Hbc::Config.global.appdir.join("container") + will_fail_if_upgraded = Cask::CaskLoader.load("will-fail-if-upgraded") + will_fail_if_upgraded_path = Cask::Config.global.appdir.join("container") expect(will_fail_if_upgraded).to be_installed expect(will_fail_if_upgraded_path).to be_a_file @@ -196,7 +196,7 @@ describe Hbc::Cmd::Upgrade, :cask do expect { described_class.run("will-fail-if-upgraded") - }.to raise_error(Hbc::CaskError).and output(output_reverted).to_stderr + }.to raise_error(Cask::CaskError).and output(output_reverted).to_stderr expect(will_fail_if_upgraded).to be_installed expect(will_fail_if_upgraded_path).to be_a_file @@ -205,8 +205,8 @@ describe Hbc::Cmd::Upgrade, :cask do end it "does not restore the old Cask if the upgrade failed pre-install" do - bad_checksum = Hbc::CaskLoader.load("bad-checksum") - bad_checksum_path = Hbc::Config.global.appdir.join("Caffeine.app") + bad_checksum = Cask::CaskLoader.load("bad-checksum") + bad_checksum_path = Cask::Config.global.appdir.join("Caffeine.app") expect(bad_checksum).to be_installed expect(bad_checksum_path).to be_a_directory @@ -214,7 +214,7 @@ describe Hbc::Cmd::Upgrade, :cask do expect { described_class.run("bad-checksum") - }.to raise_error(Hbc::CaskSha256MismatchError).and(not_to_output(output_reverted).to_stderr) + }.to raise_error(Cask::CaskSha256MismatchError).and(not_to_output(output_reverted).to_stderr) expect(bad_checksum).to be_installed expect(bad_checksum_path).to be_a_directory diff --git a/Library/Homebrew/test/cask/cmd/zap_spec.rb b/Library/Homebrew/test/cask/cmd/zap_spec.rb index 3c5fc41fc3..f7071e0e1a 100644 --- a/Library/Homebrew/test/cask/cmd/zap_spec.rb +++ b/Library/Homebrew/test/cask/cmd/zap_spec.rb @@ -1,21 +1,21 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::Cmd::Zap, :cask do +describe Cask::Cmd::Zap, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" it "shows an error when a bad Cask is provided" do expect { described_class.run("notacask") } - .to raise_error(Hbc::CaskUnavailableError, /is unavailable/) + .to raise_error(Cask::CaskUnavailableError, /is unavailable/) end it "can zap and unlink multiple Casks at once" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) - transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) + transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - Hbc::Installer.new(caffeine).install - Hbc::Installer.new(transmission).install + Cask::Installer.new(caffeine).install + Cask::Installer.new(transmission).install expect(caffeine).to be_installed expect(transmission).to be_installed @@ -23,8 +23,8 @@ describe Hbc::Cmd::Zap, :cask do described_class.run("local-caffeine", "local-transmission") expect(caffeine).not_to be_installed - expect(Hbc::Config.global.appdir.join("Caffeine.app")).not_to be_a_symlink + expect(Cask::Config.global.appdir.join("Caffeine.app")).not_to be_a_symlink expect(transmission).not_to be_installed - expect(Hbc::Config.global.appdir.join("Transmission.app")).not_to be_a_symlink + expect(Cask::Config.global.appdir.join("Transmission.app")).not_to be_a_symlink end end diff --git a/Library/Homebrew/test/cask/cmd_spec.rb b/Library/Homebrew/test/cask/cmd_spec.rb index 6d2b030e8f..987fa2ecb9 100644 --- a/Library/Homebrew/test/cask/cmd_spec.rb +++ b/Library/Homebrew/test/cask/cmd_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::Cmd, :cask do +describe Cask::Cmd, :cask do it "lists the taps for Casks that show up in two taps" do listing = described_class.nice_listing(%w[ homebrew/cask/adium @@ -28,7 +28,7 @@ describe Hbc::Cmd, :cask do context "when no option is specified" do it "--binaries is true by default" do - command = Hbc::Cmd::Install.new("some-cask") + command = Cask::Cmd::Install.new("some-cask") expect(command.binaries?).to be true end end @@ -58,15 +58,15 @@ describe Hbc::Cmd, :cask do it "respects the env variable when choosing what appdir to create" do allow(ENV).to receive(:[]).and_call_original allow(ENV).to receive(:[]).with("HOMEBREW_CASK_OPTS").and_return("--appdir=/custom/appdir") - allow(Hbc::Config.global).to receive(:appdir).and_call_original + allow(Cask::Config.global).to receive(:appdir).and_call_original described_class.run("noop") - expect(Hbc::Config.global.appdir).to eq(Pathname.new("/custom/appdir")) + expect(Cask::Config.global.appdir).to eq(Pathname.new("/custom/appdir")) end it "exits with a status of 1 when something goes wrong" do - allow(described_class).to receive(:lookup_command).and_raise(Hbc::CaskError) + allow(described_class).to receive(:lookup_command).and_raise(Cask::CaskError) command = described_class.new("noop") expect(command).to receive(:exit).with(1) command.run diff --git a/Library/Homebrew/test/cask/conflicts_with_spec.rb b/Library/Homebrew/test/cask/conflicts_with_spec.rb index 81c22ded68..5a8a676336 100644 --- a/Library/Homebrew/test/cask/conflicts_with_spec.rb +++ b/Library/Homebrew/test/cask/conflicts_with_spec.rb @@ -1,21 +1,21 @@ describe "conflicts_with", :cask do describe "conflicts_with cask" do let(:local_caffeine) { - Hbc::CaskLoader.load(cask_path("local-caffeine")) + Cask::CaskLoader.load(cask_path("local-caffeine")) } let(:with_conflicts_with) { - Hbc::CaskLoader.load(cask_path("with-conflicts-with")) + Cask::CaskLoader.load(cask_path("with-conflicts-with")) } it "installs the dependency of a Cask and the Cask itself" do - Hbc::Installer.new(local_caffeine).install + Cask::Installer.new(local_caffeine).install expect(local_caffeine).to be_installed expect { - Hbc::Installer.new(with_conflicts_with).install - }.to raise_error(Hbc::CaskConflictError, "Cask 'with-conflicts-with' conflicts with 'local-caffeine'.") + Cask::Installer.new(with_conflicts_with).install + }.to raise_error(Cask::CaskConflictError, "Cask 'with-conflicts-with' conflicts with 'local-caffeine'.") expect(with_conflicts_with).not_to be_installed end diff --git a/Library/Homebrew/test/cask/depends_on_spec.rb b/Library/Homebrew/test/cask/depends_on_spec.rb index 230daafb5d..0b01f63a2e 100644 --- a/Library/Homebrew/test/cask/depends_on_spec.rb +++ b/Library/Homebrew/test/cask/depends_on_spec.rb @@ -3,17 +3,17 @@ describe "Satisfy Dependencies and Requirements", :cask do subject { lambda do - Hbc::Installer.new(cask).install + Cask::Installer.new(cask).install end } describe "depends_on cask" do context "when depends_on cask is cyclic" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-cask-cyclic")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-cask-cyclic")) } it { is_expected.to raise_error( - Hbc::CaskCyclicDependencyError, + Cask::CaskCyclicDependencyError, "Cask 'with-depends-on-cask-cyclic' includes cyclic dependencies "\ "on other Casks: with-depends-on-cask-cyclic-helper", ) @@ -21,8 +21,8 @@ describe "Satisfy Dependencies and Requirements", :cask do end context do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-cask")) } - let(:dependency) { Hbc::CaskLoader.load(cask.depends_on.cask.first) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-cask")) } + let(:dependency) { Cask::CaskLoader.load(cask.depends_on.cask.first) } it "installs the dependency of a Cask and the Cask itself" do expect(subject).not_to raise_error @@ -34,39 +34,39 @@ describe "Satisfy Dependencies and Requirements", :cask do describe "depends_on macos" do context "given an array" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-macos-array")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-array")) } it { is_expected.not_to raise_error } end context "given a comparison" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-macos-comparison")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-comparison")) } it { is_expected.not_to raise_error } end context "given a string" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-macos-string")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-string")) } it { is_expected.not_to raise_error } end context "given a symbol" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-macos-symbol")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-symbol")) } it { is_expected.not_to raise_error } end context "when not satisfied" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-macos-failure")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-failure")) } - it { is_expected.to raise_error(Hbc::CaskError) } + it { is_expected.to raise_error(Cask::CaskError) } end end describe "depends_on arch" do context "when satisfied" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-arch")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-arch")) } it { is_expected.not_to raise_error } end @@ -78,21 +78,21 @@ describe "Satisfy Dependencies and Requirements", :cask do end context "when satisfied" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-x11")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11")) } let(:x11_installed) { true } it { is_expected.not_to raise_error } end context "when not satisfied" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-x11")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11")) } let(:x11_installed) { false } - it { is_expected.to raise_error(Hbc::CaskX11DependencyError) } + it { is_expected.to raise_error(Cask::CaskX11DependencyError) } end context "when depends_on x11: false" do - let(:cask) { Hbc::CaskLoader.load(cask_path("with-depends-on-x11-false")) } + let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11-false")) } let(:x11_installed) { false } it { is_expected.not_to raise_error } diff --git a/Library/Homebrew/test/cask/dsl/appcast_spec.rb b/Library/Homebrew/test/cask/dsl/appcast_spec.rb index cd85cdecc1..e1f53ce0d6 100644 --- a/Library/Homebrew/test/cask/dsl/appcast_spec.rb +++ b/Library/Homebrew/test/cask/dsl/appcast_spec.rb @@ -1,6 +1,6 @@ require "cmd/cask" -describe Hbc::DSL::Appcast do +describe Cask::DSL::Appcast do subject { described_class.new(url, params) } let(:url) { "https://example.com" } diff --git a/Library/Homebrew/test/cask/dsl/caveats_spec.rb b/Library/Homebrew/test/cask/dsl/caveats_spec.rb index f91046e308..e040e7fe92 100644 --- a/Library/Homebrew/test/cask/dsl/caveats_spec.rb +++ b/Library/Homebrew/test/cask/dsl/caveats_spec.rb @@ -1,10 +1,10 @@ require "test/support/helper/spec/shared_examples/cask_dsl_base" -describe Hbc::DSL::Caveats, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("basic-cask")) } - let(:dsl) { Hbc::DSL::Caveats.new(cask) } +describe Cask::DSL::Caveats, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } + let(:dsl) { Cask::DSL::Caveats.new(cask) } - it_behaves_like Hbc::DSL::Base + it_behaves_like Cask::DSL::Base # TODO: add tests for Caveats DSL methods end diff --git a/Library/Homebrew/test/cask/dsl/postflight_spec.rb b/Library/Homebrew/test/cask/dsl/postflight_spec.rb index 0fd4c1317f..75dbc5885b 100644 --- a/Library/Homebrew/test/cask/dsl/postflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/postflight_spec.rb @@ -1,13 +1,13 @@ require "test/support/helper/spec/shared_examples/cask_dsl_base" require "test/support/helper/spec/shared_examples/cask_staged" -describe Hbc::DSL::Postflight, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("basic-cask")) } - let(:dsl) { Hbc::DSL::Postflight.new(cask, FakeSystemCommand) } +describe Cask::DSL::Postflight, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } + let(:dsl) { Cask::DSL::Postflight.new(cask, FakeSystemCommand) } - it_behaves_like Hbc::DSL::Base + it_behaves_like Cask::DSL::Base - it_behaves_like Hbc::Staged do + it_behaves_like Cask::Staged do let(:staged) { dsl } end end diff --git a/Library/Homebrew/test/cask/dsl/preflight_spec.rb b/Library/Homebrew/test/cask/dsl/preflight_spec.rb index 70193154e2..8d68342a5b 100644 --- a/Library/Homebrew/test/cask/dsl/preflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/preflight_spec.rb @@ -1,13 +1,13 @@ require "test/support/helper/spec/shared_examples/cask_dsl_base" require "test/support/helper/spec/shared_examples/cask_staged" -describe Hbc::DSL::Preflight, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("basic-cask")) } - let(:dsl) { Hbc::DSL::Preflight.new(cask, FakeSystemCommand) } +describe Cask::DSL::Preflight, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } + let(:dsl) { Cask::DSL::Preflight.new(cask, FakeSystemCommand) } - it_behaves_like Hbc::DSL::Base + it_behaves_like Cask::DSL::Base - it_behaves_like Hbc::Staged do + it_behaves_like Cask::Staged do let(:staged) { dsl } end end diff --git a/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb b/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb index 540e2504a4..71b258bd7b 100644 --- a/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb @@ -1,8 +1,8 @@ require "test/support/helper/spec/shared_examples/cask_dsl_base" -describe Hbc::DSL::UninstallPostflight, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("basic-cask")) } - let(:dsl) { Hbc::DSL::UninstallPostflight.new(cask, FakeSystemCommand) } +describe Cask::DSL::UninstallPostflight, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } + let(:dsl) { Cask::DSL::UninstallPostflight.new(cask, FakeSystemCommand) } - it_behaves_like Hbc::DSL::Base + it_behaves_like Cask::DSL::Base end diff --git a/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb b/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb index ff1fdc63e2..28fe96dfc7 100644 --- a/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb @@ -1,13 +1,13 @@ require "test/support/helper/spec/shared_examples/cask_dsl_base" require "test/support/helper/spec/shared_examples/cask_staged" -describe Hbc::DSL::UninstallPreflight, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path("basic-cask")) } - let(:dsl) { Hbc::DSL::UninstallPreflight.new(cask, FakeSystemCommand) } +describe Cask::DSL::UninstallPreflight, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } + let(:dsl) { Cask::DSL::UninstallPreflight.new(cask, FakeSystemCommand) } - it_behaves_like Hbc::DSL::Base + it_behaves_like Cask::DSL::Base - it_behaves_like Hbc::Staged do + it_behaves_like Cask::Staged do let(:staged) { dsl } end end diff --git a/Library/Homebrew/test/cask/dsl/version_spec.rb b/Library/Homebrew/test/cask/dsl/version_spec.rb index b35fb6287f..3a84860b67 100644 --- a/Library/Homebrew/test/cask/dsl/version_spec.rb +++ b/Library/Homebrew/test/cask/dsl/version_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::DSL::Version, :cask do +describe Cask::DSL::Version, :cask do shared_examples "expectations hash" do |input_name, expectations| expectations.each do |input_value, expected_output| context "when #{input_name} is #{input_value.inspect}" do diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index b5fef6e2c0..fb1d05c60e 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -1,5 +1,5 @@ -describe Hbc::DSL, :cask do - let(:cask) { Hbc::CaskLoader.load(cask_path(token.to_s)) } +describe Cask::DSL, :cask do + let(:cask) { Cask::CaskLoader.load(cask_path(token.to_s)) } let(:token) { "basic-cask" } context "stanzas" do @@ -13,7 +13,7 @@ describe Hbc::DSL, :cask do describe "when a Cask includes an unknown method" do let(:attempt_unknown_method) { lambda do - Hbc::Cask.new("unexpected-method-cask") do + Cask::Cask.new("unexpected-method-cask") do future_feature :not_yet_on_your_machine end end @@ -46,7 +46,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-header-format" } it "raises an error" do - expect { cask }.to raise_error(Hbc::CaskUnreadableError) + expect { cask }.to raise_error(Cask::CaskUnreadableError) end end @@ -56,7 +56,7 @@ describe Hbc::DSL, :cask do it "raises an error" do expect { cask - }.to raise_error(Hbc::CaskTokenMismatchError, /header line does not match the file name/) + }.to raise_error(Cask::CaskTokenMismatchError, /header line does not match the file name/) end end @@ -74,7 +74,7 @@ describe Hbc::DSL, :cask do describe "name stanza" do it "lets you set the full name via a name stanza" do - cask = Hbc::Cask.new("name-cask") do + cask = Cask::Cask.new("name-cask") do name "Proper Name" end @@ -84,7 +84,7 @@ describe Hbc::DSL, :cask do end it "Accepts an array value to the name stanza" do - cask = Hbc::Cask.new("array-name-cask") do + cask = Cask::Cask.new("array-name-cask") do name ["Proper Name", "Alternate Name"] end @@ -95,7 +95,7 @@ describe Hbc::DSL, :cask do end it "Accepts multiple name stanzas" do - cask = Hbc::Cask.new("multi-name-cask") do + cask = Cask::Cask.new("multi-name-cask") do name "Proper Name" name "Alternate Name" end @@ -109,7 +109,7 @@ describe Hbc::DSL, :cask do describe "sha256 stanza" do it "lets you set checksum via sha256" do - cask = Hbc::Cask.new("checksum-cask") do + cask = Cask::Cask.new("checksum-cask") do sha256 "imasha2" end @@ -120,7 +120,7 @@ describe Hbc::DSL, :cask do describe "language stanza" do it "allows multilingual casks" do cask = lambda do - Hbc::Cask.new("cask-with-apps") do + Cask::Cask.new("cask-with-apps") do language "zh" do sha256 "abc123" "zh-CN" @@ -168,7 +168,7 @@ describe Hbc::DSL, :cask do it "returns an empty array if no languages are specified" do cask = lambda do - Hbc::Cask.new("cask-with-apps") do + Cask::Cask.new("cask-with-apps") do url "https://example.org/file.zip" end end @@ -178,7 +178,7 @@ describe Hbc::DSL, :cask do it "returns an array of available languages" do cask = lambda do - Hbc::Cask.new("cask-with-apps") do + Cask::Cask.new("cask-with-apps") do language "zh" do sha256 "abc123" "zh-CN" @@ -199,7 +199,7 @@ describe Hbc::DSL, :cask do describe "app stanza" do it "allows you to specify app stanzas" do - cask = Hbc::Cask.new("cask-with-apps") do + cask = Cask::Cask.new("cask-with-apps") do app "Foo.app" app "Bar.app" end @@ -208,18 +208,18 @@ describe Hbc::DSL, :cask do end it "allow app stanzas to be empty" do - cask = Hbc::Cask.new("cask-with-no-apps") + cask = Cask::Cask.new("cask-with-no-apps") expect(cask.artifacts).to be_empty end end describe "caveats stanza" do it "allows caveats to be specified via a method define" do - cask = Hbc::Cask.new("plain-cask") + cask = Cask::Cask.new("plain-cask") expect(cask.caveats).to be_empty - cask = Hbc::Cask.new("cask-with-caveats") do + cask = Cask::Cask.new("cask-with-caveats") do def caveats <<~EOS When you install this Cask, you probably want to know this. @@ -233,7 +233,7 @@ describe Hbc::DSL, :cask do describe "pkg stanza" do it "allows installable pkgs to be specified" do - cask = Hbc::Cask.new("cask-with-pkgs") do + cask = Cask::Cask.new("cask-with-pkgs") do pkg "Foo.pkg" pkg "Bar.pkg" end @@ -246,7 +246,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-two-url" } it "prevents defining multiple urls" do - expect { cask }.to raise_error(Hbc::CaskInvalidError, /'url' stanza may only appear once/) + expect { cask }.to raise_error(Cask::CaskInvalidError, /'url' stanza may only appear once/) end end @@ -254,7 +254,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-two-homepage" } it "prevents defining multiple homepages" do - expect { cask }.to raise_error(Hbc::CaskInvalidError, /'homepage' stanza may only appear once/) + expect { cask }.to raise_error(Cask::CaskInvalidError, /'homepage' stanza may only appear once/) end end @@ -262,7 +262,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-two-version" } it "prevents defining multiple versions" do - expect { cask }.to raise_error(Hbc::CaskInvalidError, /'version' stanza may only appear once/) + expect { cask }.to raise_error(Cask::CaskInvalidError, /'version' stanza may only appear once/) end end @@ -277,7 +277,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-appcast-multiple" } it "raises an error" do - expect { cask }.to raise_error(Hbc::CaskInvalidError, /'appcast' stanza may only appear once/) + expect { cask }.to raise_error(Cask::CaskInvalidError, /'appcast' stanza may only appear once/) end end @@ -285,7 +285,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-appcast-url" } it "refuses to load" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end end @@ -294,7 +294,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-depends-on-key" } it "refuses to load with an invalid depends_on key" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end @@ -347,7 +347,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-depends-on-macos-bad-release" } it "refuses to load" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end @@ -355,7 +355,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-depends-on-macos-conflicting-forms" } it "refuses to load" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end end @@ -373,7 +373,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-depends-on-arch-value" } it "refuses to load" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end end @@ -391,7 +391,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-depends-on-x11-value" } it "refuses to load" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end end @@ -409,7 +409,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-conflicts-with-key" } it "refuses to load invalid conflicts_with key" do - expect { cask }.to raise_error(Hbc::CaskInvalidError) + expect { cask }.to raise_error(Cask::CaskInvalidError) end end end @@ -431,7 +431,7 @@ describe Hbc::DSL, :cask do it "allows installer manual to be specified" do installer = cask.artifacts.first - expect(installer).to be_a(Hbc::Artifact::Installer::ManualInstaller) + expect(installer).to be_a(Cask::Artifact::Installer::ManualInstaller) expect(installer.path).to eq(Pathname("Caffeine.app")) end end @@ -442,7 +442,7 @@ describe Hbc::DSL, :cask do let(:token) { "stage-only" } it "allows stage_only stanza to be specified" do - expect(cask.artifacts).to contain_exactly a_kind_of Hbc::Artifact::StageOnly + expect(cask.artifacts).to contain_exactly a_kind_of Cask::Artifact::StageOnly end end @@ -450,7 +450,7 @@ describe Hbc::DSL, :cask do let(:token) { "invalid/invalid-stage-only-conflict" } it "prevents specifying stage_only" do - expect { cask }.to raise_error(Hbc::CaskInvalidError, /'stage_only' must be the only activatable artifact/) + expect { cask }.to raise_error(Cask::CaskInvalidError, /'stage_only' must be the only activatable artifact/) end end end @@ -468,29 +468,29 @@ describe Hbc::DSL, :cask do let(:token) { "appdir-interpolation" } it "is allowed" do - expect(cask.artifacts.first.source).to eq(Hbc::Config.global.appdir/"some/path") + expect(cask.artifacts.first.source).to eq(Cask::Config.global.appdir/"some/path") end end it "does not include a trailing slash" do begin - original_appdir = Hbc::Config.global.appdir - Hbc::Config.global.appdir = "#{original_appdir}/" + original_appdir = Cask::Config.global.appdir + Cask::Config.global.appdir = "#{original_appdir}/" - cask = Hbc::Cask.new("appdir-trailing-slash") do + cask = Cask::Cask.new("appdir-trailing-slash") do binary "#{appdir}/some/path" end expect(cask.artifacts.first.source).to eq(original_appdir/"some/path") ensure - Hbc::Config.global.appdir = original_appdir + Cask::Config.global.appdir = original_appdir end end end describe "#artifacts" do it "sorts artifacts according to the preferable installation order" do - cask = Hbc::Cask.new("appdir-trailing-slash") do + cask = Cask::Cask.new("appdir-trailing-slash") do postflight do next end diff --git a/Library/Homebrew/test/cask/installer_spec.rb b/Library/Homebrew/test/cask/installer_spec.rb index dd96105b6d..a03290e124 100644 --- a/Library/Homebrew/test/cask/installer_spec.rb +++ b/Library/Homebrew/test/cask/installer_spec.rb @@ -1,115 +1,115 @@ -describe Hbc::Installer, :cask do +describe Cask::Installer, :cask do describe "install" do let(:empty_depends_on_stub) { double(formula: [], cask: [], macos: nil, arch: nil, x11: nil) } it "downloads and installs a nice fresh Cask" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) - Hbc::Installer.new(caffeine).install + Cask::Installer.new(caffeine).install - expect(Hbc::Caskroom.path.join("local-caffeine", caffeine.version)).to be_a_directory - expect(Hbc::Config.global.appdir.join("Caffeine.app")).to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", caffeine.version)).to be_a_directory + expect(Cask::Config.global.appdir.join("Caffeine.app")).to be_a_directory end it "works with dmg-based Casks" do - asset = Hbc::CaskLoader.load(cask_path("container-dmg")) + asset = Cask::CaskLoader.load(cask_path("container-dmg")) - Hbc::Installer.new(asset).install + Cask::Installer.new(asset).install - expect(Hbc::Caskroom.path.join("container-dmg", asset.version)).to be_a_directory - expect(Hbc::Config.global.appdir.join("container")).to be_a_file + expect(Cask::Caskroom.path.join("container-dmg", asset.version)).to be_a_directory + expect(Cask::Config.global.appdir.join("container")).to be_a_file end it "works with tar-gz-based Casks" do - asset = Hbc::CaskLoader.load(cask_path("container-tar-gz")) + asset = Cask::CaskLoader.load(cask_path("container-tar-gz")) - Hbc::Installer.new(asset).install + Cask::Installer.new(asset).install - expect(Hbc::Caskroom.path.join("container-tar-gz", asset.version)).to be_a_directory - expect(Hbc::Config.global.appdir.join("container")).to be_a_file + expect(Cask::Caskroom.path.join("container-tar-gz", asset.version)).to be_a_directory + expect(Cask::Config.global.appdir.join("container")).to be_a_file end it "works with xar-based Casks" do - asset = Hbc::CaskLoader.load(cask_path("container-xar")) + asset = Cask::CaskLoader.load(cask_path("container-xar")) - Hbc::Installer.new(asset).install + Cask::Installer.new(asset).install - expect(Hbc::Caskroom.path.join("container-xar", asset.version)).to be_a_directory - expect(Hbc::Config.global.appdir.join("container")).to be_a_file + expect(Cask::Caskroom.path.join("container-xar", asset.version)).to be_a_directory + expect(Cask::Config.global.appdir.join("container")).to be_a_file end it "works with pure bzip2-based Casks" do - asset = Hbc::CaskLoader.load(cask_path("container-bzip2")) + asset = Cask::CaskLoader.load(cask_path("container-bzip2")) - Hbc::Installer.new(asset).install + Cask::Installer.new(asset).install - expect(Hbc::Caskroom.path.join("container-bzip2", asset.version)).to be_a_directory - expect(Hbc::Config.global.appdir.join("container")).to be_a_file + expect(Cask::Caskroom.path.join("container-bzip2", asset.version)).to be_a_directory + expect(Cask::Config.global.appdir.join("container")).to be_a_file end it "works with pure gzip-based Casks" do - asset = Hbc::CaskLoader.load(cask_path("container-gzip")) + asset = Cask::CaskLoader.load(cask_path("container-gzip")) - Hbc::Installer.new(asset).install + Cask::Installer.new(asset).install - expect(Hbc::Caskroom.path.join("container-gzip", asset.version)).to be_a_directory - expect(Hbc::Config.global.appdir.join("container")).to be_a_file + expect(Cask::Caskroom.path.join("container-gzip", asset.version)).to be_a_directory + expect(Cask::Config.global.appdir.join("container")).to be_a_file end it "blows up on a bad checksum" do - bad_checksum = Hbc::CaskLoader.load(cask_path("bad-checksum")) + bad_checksum = Cask::CaskLoader.load(cask_path("bad-checksum")) expect { - Hbc::Installer.new(bad_checksum).install - }.to raise_error(Hbc::CaskSha256MismatchError) + Cask::Installer.new(bad_checksum).install + }.to raise_error(Cask::CaskSha256MismatchError) end it "blows up on a missing checksum" do - missing_checksum = Hbc::CaskLoader.load(cask_path("missing-checksum")) + missing_checksum = Cask::CaskLoader.load(cask_path("missing-checksum")) expect { - Hbc::Installer.new(missing_checksum).install - }.to raise_error(Hbc::CaskSha256MissingError) + Cask::Installer.new(missing_checksum).install + }.to raise_error(Cask::CaskSha256MissingError) end it "installs fine if sha256 :no_check is used" do - no_checksum = Hbc::CaskLoader.load(cask_path("no-checksum")) + no_checksum = Cask::CaskLoader.load(cask_path("no-checksum")) - Hbc::Installer.new(no_checksum).install + Cask::Installer.new(no_checksum).install expect(no_checksum).to be_installed end it "fails to install if sha256 :no_check is used with --require-sha" do - no_checksum = Hbc::CaskLoader.load(cask_path("no-checksum")) + no_checksum = Cask::CaskLoader.load(cask_path("no-checksum")) expect { - Hbc::Installer.new(no_checksum, require_sha: true).install - }.to raise_error(Hbc::CaskNoShasumError) + Cask::Installer.new(no_checksum, require_sha: true).install + }.to raise_error(Cask::CaskNoShasumError) end it "installs fine if sha256 :no_check is used with --require-sha and --force" do - no_checksum = Hbc::CaskLoader.load(cask_path("no-checksum")) + no_checksum = Cask::CaskLoader.load(cask_path("no-checksum")) - Hbc::Installer.new(no_checksum, require_sha: true, force: true).install + Cask::Installer.new(no_checksum, require_sha: true, force: true).install expect(no_checksum).to be_installed end it "prints caveats if they're present" do - with_caveats = Hbc::CaskLoader.load(cask_path("with-caveats")) + with_caveats = Cask::CaskLoader.load(cask_path("with-caveats")) expect { - Hbc::Installer.new(with_caveats).install + Cask::Installer.new(with_caveats).install }.to output(/Here are some things you might want to know/).to_stdout expect(with_caveats).to be_installed end it "prints installer :manual instructions when present" do - with_installer_manual = Hbc::CaskLoader.load(cask_path("with-installer-manual")) + with_installer_manual = Cask::CaskLoader.load(cask_path("with-installer-manual")) expect { - Hbc::Installer.new(with_installer_manual).install + Cask::Installer.new(with_installer_manual).install }.to output( <<~EOS ==> Satisfying dependencies @@ -128,89 +128,89 @@ describe Hbc::Installer, :cask do end it "does not extract __MACOSX directories from zips" do - with_macosx_dir = Hbc::CaskLoader.load(cask_path("with-macosx-dir")) + with_macosx_dir = Cask::CaskLoader.load(cask_path("with-macosx-dir")) - Hbc::Installer.new(with_macosx_dir).install + Cask::Installer.new(with_macosx_dir).install expect(with_macosx_dir.staged_path.join("__MACOSX")).not_to be_a_directory end it "allows already-installed Casks which auto-update to be installed if force is provided" do - with_auto_updates = Hbc::CaskLoader.load(cask_path("auto-updates")) + with_auto_updates = Cask::CaskLoader.load(cask_path("auto-updates")) expect(with_auto_updates).not_to be_installed - Hbc::Installer.new(with_auto_updates).install + Cask::Installer.new(with_auto_updates).install expect { - Hbc::Installer.new(with_auto_updates, force: true).install + Cask::Installer.new(with_auto_updates, force: true).install }.not_to raise_error end # unlike the CLI, the internal interface throws exception on double-install it "installer method raises an exception when already-installed Casks are attempted" do - transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) + transmission = Cask::CaskLoader.load(cask_path("local-transmission")) expect(transmission).not_to be_installed - installer = Hbc::Installer.new(transmission) + installer = Cask::Installer.new(transmission) installer.install expect { installer.install - }.to raise_error(Hbc::CaskAlreadyInstalledError) + }.to raise_error(Cask::CaskAlreadyInstalledError) end it "allows already-installed Casks to be installed if force is provided" do - transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) + transmission = Cask::CaskLoader.load(cask_path("local-transmission")) expect(transmission).not_to be_installed - Hbc::Installer.new(transmission).install + Cask::Installer.new(transmission).install expect { - Hbc::Installer.new(transmission, force: true).install + Cask::Installer.new(transmission, force: true).install }.not_to raise_error end it "works naked-pkg-based Casks" do - naked_pkg = Hbc::CaskLoader.load(cask_path("container-pkg")) + naked_pkg = Cask::CaskLoader.load(cask_path("container-pkg")) - Hbc::Installer.new(naked_pkg).install + Cask::Installer.new(naked_pkg).install - expect(Hbc::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg")).to be_a_file + expect(Cask::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg")).to be_a_file end it "works properly with an overridden container :type" do - naked_executable = Hbc::CaskLoader.load(cask_path("naked-executable")) + naked_executable = Cask::CaskLoader.load(cask_path("naked-executable")) - Hbc::Installer.new(naked_executable).install + Cask::Installer.new(naked_executable).install - expect(Hbc::Caskroom.path.join("naked-executable", naked_executable.version, "naked_executable")).to be_a_file + expect(Cask::Caskroom.path.join("naked-executable", naked_executable.version, "naked_executable")).to be_a_file end it "works fine with a nested container" do - nested_app = Hbc::CaskLoader.load(cask_path("nested-app")) + nested_app = Cask::CaskLoader.load(cask_path("nested-app")) - Hbc::Installer.new(nested_app).install + Cask::Installer.new(nested_app).install - expect(Hbc::Config.global.appdir.join("MyNestedApp.app")).to be_a_directory + expect(Cask::Config.global.appdir.join("MyNestedApp.app")).to be_a_directory end it "generates and finds a timestamped metadata directory for an installed Cask" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) - Hbc::Installer.new(caffeine).install + Cask::Installer.new(caffeine).install m_path = caffeine.metadata_timestamped_path(timestamp: :now, create: true) expect(caffeine.metadata_timestamped_path(timestamp: :latest)).to eq(m_path) end it "generates and finds a metadata subdirectory for an installed Cask" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) - Hbc::Installer.new(caffeine).install + Cask::Installer.new(caffeine).install subdir_name = "Casks" m_subdir = caffeine.metadata_subdir(subdir_name, timestamp: :now, create: true) @@ -220,35 +220,35 @@ describe Hbc::Installer, :cask do describe "uninstall" do it "fully uninstalls a Cask" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) - installer = Hbc::Installer.new(caffeine) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) + installer = Cask::Installer.new(caffeine) installer.install installer.uninstall - expect(Hbc::Caskroom.path.join("local-caffeine", caffeine.version, "Caffeine.app")).not_to be_a_directory - expect(Hbc::Caskroom.path.join("local-caffeine", caffeine.version)).not_to be_a_directory - expect(Hbc::Caskroom.path.join("local-caffeine")).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", caffeine.version, "Caffeine.app")).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", caffeine.version)).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine")).not_to be_a_directory end it "uninstalls all versions if force is set" do - caffeine = Hbc::CaskLoader.load(cask_path("local-caffeine")) + caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) mutated_version = caffeine.version + ".1" - Hbc::Installer.new(caffeine).install + Cask::Installer.new(caffeine).install - expect(Hbc::Caskroom.path.join("local-caffeine", caffeine.version)).to be_a_directory - expect(Hbc::Caskroom.path.join("local-caffeine", mutated_version)).not_to be_a_directory - FileUtils.mv(Hbc::Caskroom.path.join("local-caffeine", caffeine.version), - Hbc::Caskroom.path.join("local-caffeine", mutated_version)) - expect(Hbc::Caskroom.path.join("local-caffeine", caffeine.version)).not_to be_a_directory - expect(Hbc::Caskroom.path.join("local-caffeine", mutated_version)).to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", caffeine.version)).to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", mutated_version)).not_to be_a_directory + FileUtils.mv(Cask::Caskroom.path.join("local-caffeine", caffeine.version), + Cask::Caskroom.path.join("local-caffeine", mutated_version)) + expect(Cask::Caskroom.path.join("local-caffeine", caffeine.version)).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", mutated_version)).to be_a_directory - Hbc::Installer.new(caffeine, force: true).uninstall + Cask::Installer.new(caffeine, force: true).uninstall - expect(Hbc::Caskroom.path.join("local-caffeine", caffeine.version)).not_to be_a_directory - expect(Hbc::Caskroom.path.join("local-caffeine", mutated_version)).not_to be_a_directory - expect(Hbc::Caskroom.path.join("local-caffeine")).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", caffeine.version)).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine", mutated_version)).not_to be_a_directory + expect(Cask::Caskroom.path.join("local-caffeine")).not_to be_a_directory end end end diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index cde09e01ec..e64de0d9fe 100644 --- a/Library/Homebrew/test/cask/pkg_spec.rb +++ b/Library/Homebrew/test/cask/pkg_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::Pkg, :cask do +describe Cask::Pkg, :cask do describe "#uninstall" do let(:fake_system_command) { NeverSudoSystemCommand } let(:empty_response) { double(stdout: "", plist: { "volume" => "/", "install-location" => "", "paths" => {} }) } @@ -144,7 +144,7 @@ describe Hbc::Pkg, :cask do end it "correctly parses a Property List" do - pkg = Hbc::Pkg.new(pkg_id, fake_system_command) + pkg = Cask::Pkg.new(pkg_id, fake_system_command) expect(fake_system_command).to receive(:run!).with( "/usr/sbin/pkgutil", diff --git a/Library/Homebrew/test/cask/staged_spec.rb b/Library/Homebrew/test/cask/staged_spec.rb index b6dfc73765..6f1322dd26 100644 --- a/Library/Homebrew/test/cask/staged_spec.rb +++ b/Library/Homebrew/test/cask/staged_spec.rb @@ -3,8 +3,8 @@ # to be invoking bundle_identifier off of the installer instance. describe "Operations on staged Casks", :cask do describe "bundle ID" do - let(:cask) { Hbc::CaskLoader.load(cask_path("local-transmission")) } - let(:installer) { Hbc::Installer.new(cask) } + let(:cask) { Cask::CaskLoader.load(cask_path("local-transmission")) } + let(:installer) { Cask::Installer.new(cask) } it "fetches the bundle ID from a staged cask" do installer.install diff --git a/Library/Homebrew/test/cask/verify_spec.rb b/Library/Homebrew/test/cask/verify_spec.rb index 2a46df01c8..b40461a539 100644 --- a/Library/Homebrew/test/cask/verify_spec.rb +++ b/Library/Homebrew/test/cask/verify_spec.rb @@ -1,4 +1,4 @@ -module Hbc +module Cask describe Verify, :cask do describe "::all" do subject(:verification) { described_class.all(cask, downloaded_path) } diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb index 3ec556fdeb..7e710e88c8 100644 --- a/Library/Homebrew/test/cleanup_spec.rb +++ b/Library/Homebrew/test/cleanup_spec.rb @@ -138,14 +138,14 @@ describe Homebrew::Cleanup do describe "#cleanup_cask", :cask do before(:each) do - Hbc::Cache.path.mkpath + Cask::Cache.path.mkpath end context "when given a versioned cask" do - let(:cask) { Hbc::CaskLoader.load("local-transmission") } + let(:cask) { Cask::CaskLoader.load("local-transmission") } it "removes the download if it is not for the latest version" do - download = Hbc::Cache.path/"#{cask.token}--7.8.9" + download = Cask::Cache.path/"#{cask.token}--7.8.9" FileUtils.touch download @@ -155,7 +155,7 @@ describe Homebrew::Cleanup do end it "does not remove downloads for the latest version" do - download = Hbc::Cache.path/"#{cask.token}--#{cask.version}" + download = Cask::Cache.path/"#{cask.token}--#{cask.version}" FileUtils.touch download @@ -166,10 +166,10 @@ describe Homebrew::Cleanup do end context "when given a `:latest` cask" do - let(:cask) { Hbc::CaskLoader.load("latest-with-appcast") } + let(:cask) { Cask::CaskLoader.load("latest-with-appcast") } it "does not remove the download for the latest version" do - download = Hbc::Cache.path/"#{cask.token}--#{cask.version}" + download = Cask::Cache.path/"#{cask.token}--#{cask.version}" FileUtils.touch download @@ -179,7 +179,7 @@ describe Homebrew::Cleanup do end it "removes the download for the latest version after a week" do - download = Hbc::Cache.path/"#{cask.token}--#{cask.version}" + download = Cask::Cache.path/"#{cask.token}--#{cask.version}" FileUtils.touch download, mtime: Time.now - 7 * 60 * 60 * 24 diff --git a/Library/Homebrew/test/support/helper/cask/install_helper.rb b/Library/Homebrew/test/support/helper/cask/install_helper.rb index 1205512bff..eb206c0bd8 100644 --- a/Library/Homebrew/test/support/helper/cask/install_helper.rb +++ b/Library/Homebrew/test/support/helper/cask/install_helper.rb @@ -2,14 +2,14 @@ module InstallHelper module_function def self.install_without_artifacts(cask) - Hbc::Installer.new(cask).tap do |i| + Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container end end def self.install_without_artifacts_with_caskfile(cask) - Hbc::Installer.new(cask).tap do |i| + Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container i.save_caskfile @@ -17,13 +17,13 @@ module InstallHelper end def install_without_artifacts(cask) - Hbc::Installer.new(cask).tap do |i| + Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container end end def install_with_caskfile(cask) - Hbc::Installer.new(cask).tap(&:save_caskfile) + Cask::Installer.new(cask).tap(&:save_caskfile) end end diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb index 6aa9f5a04e..5e8b1d13a6 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb @@ -14,7 +14,7 @@ HOMEBREW_CASK_DIRS = { RSpec.shared_context "Homebrew Cask", :needs_macos do before do HOMEBREW_CASK_DIRS.each do |method, path| - allow(Hbc::Config.global).to receive(method).and_return(path) + allow(Cask::Config.global).to receive(method).and_return(path) end end @@ -23,7 +23,7 @@ RSpec.shared_context "Homebrew Cask", :needs_macos do begin HOMEBREW_CASK_DIRS.values.each(&:mkpath) - Hbc::Config.global.binarydir.mkpath + Cask::Config.global.binarydir.mkpath Tap.default_cask_tap.tap do |tap| FileUtils.mkdir_p tap.path.dirname @@ -38,7 +38,7 @@ RSpec.shared_context "Homebrew Cask", :needs_macos do example.run ensure FileUtils.rm_rf HOMEBREW_CASK_DIRS.values - FileUtils.rm_rf [Hbc::Config.global.binarydir, Hbc::Caskroom.path, Hbc::Cache.path] + FileUtils.rm_rf [Cask::Config.global.binarydir, Cask::Caskroom.path, Cask::Cache.path] Tap.default_cask_tap.path.unlink third_party_tap.path.unlink FileUtils.rm_rf third_party_tap.path.parent diff --git a/Library/Homebrew/test/support/helper/spec/shared_examples/cask_dsl_base.rb b/Library/Homebrew/test/support/helper/spec/shared_examples/cask_dsl_base.rb index b1431d2bcb..ccb425dd78 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_examples/cask_dsl_base.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_examples/cask_dsl_base.rb @@ -1,6 +1,6 @@ require "cask/dsl/base" -shared_examples Hbc::DSL::Base do +shared_examples Cask::DSL::Base do it "supports the token method" do expect(dsl.token).to eq(cask.token) end diff --git a/Library/Homebrew/test/support/helper/spec/shared_examples/cask_staged.rb b/Library/Homebrew/test/support/helper/spec/shared_examples/cask_staged.rb index 8d56439895..cd154facab 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_examples/cask_staged.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_examples/cask_staged.rb @@ -1,6 +1,6 @@ require "cask/staged" -shared_examples Hbc::Staged do +shared_examples Cask::Staged do let(:existing_path) { Pathname.new("/path/to/file/that/exists") } let(:non_existent_path) { Pathname.new("/path/to/file/that/does/not/exist") } @@ -22,7 +22,7 @@ shared_examples Hbc::Staged do end it "can get the Info.plist file for the primary app" do - expect(staged.info_plist_file).to eq Hbc::Config.global.appdir.join("TestCask.app/Contents/Info.plist") + expect(staged.info_plist_file).to eq Cask::Config.global.appdir.join("TestCask.app/Contents/Info.plist") end it "can execute commands on the Info.plist file" do diff --git a/Library/Homebrew/unpack_strategy/air.rb b/Library/Homebrew/unpack_strategy/air.rb index 7ef51b4b95..393b9e8d11 100644 --- a/Library/Homebrew/unpack_strategy/air.rb +++ b/Library/Homebrew/unpack_strategy/air.rb @@ -16,7 +16,7 @@ module UnpackStrategy end def dependencies - @dependencies ||= [Hbc::CaskLoader.load("adobe-air")] + @dependencies ||= [Cask::CaskLoader.load("adobe-air")] end AIR_APPLICATION_INSTALLER = diff --git a/Library/Homebrew/update_migrator.rb b/Library/Homebrew/update_migrator.rb index a75e735a09..a71c00be79 100644 --- a/Library/Homebrew/update_migrator.rb +++ b/Library/Homebrew/update_migrator.rb @@ -110,8 +110,8 @@ module UpdateMigrator load_cask = lambda do |cask| begin - Hbc::CaskLoader.load(cask) - rescue Hbc::CaskUnavailableError + Cask::CaskLoader.load(cask) + rescue Cask::CaskUnavailableError nil end end @@ -127,7 +127,7 @@ module UpdateMigrator cache_entries.call(HOMEBREW_CACHE/"Cask") .map(&load_cask) .compact - .map { |cask| [Hbc::Download.new(cask).downloader, cask.token, cask.version] } + .map { |cask| [Cask::Download.new(cask).downloader, cask.token, cask.version] } downloaders = formula_downloaders + cask_downloaders