diff options
Diffstat (limited to 'Library/Homebrew/test/cask')
31 files changed, 136 insertions, 375 deletions
diff --git a/Library/Homebrew/test/cask/accessibility_spec.rb b/Library/Homebrew/test/cask/accessibility_spec.rb index 4ac757e69..9e56f6bd3 100644 --- a/Library/Homebrew/test/cask/accessibility_spec.rb +++ b/Library/Homebrew/test/cask/accessibility_spec.rb @@ -20,9 +20,7 @@ describe "Accessibility Access", :cask do sudo: true, ) - shutup do - installer.enable_accessibility_access - end + installer.enable_accessibility_access end it "warns about disabling accessibility access on old macOS releases" do @@ -42,9 +40,7 @@ describe "Accessibility Access", :cask do sudo: true, ) - shutup do - installer.enable_accessibility_access - end + installer.enable_accessibility_access end it "can disable accessibility access" do @@ -54,9 +50,7 @@ describe "Accessibility Access", :cask do sudo: true, ) - shutup do - installer.disable_accessibility_access - end + installer.disable_accessibility_access end end diff --git a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb index 9bcdd27a1..9e8d83bb4 100644 --- a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb +++ b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb @@ -17,9 +17,7 @@ describe Hbc::Artifact::App, :cask do expect(source_path).to be_a_directory expect(target_path).not_to exist - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -40,9 +38,7 @@ describe Hbc::Artifact::App, :cask do appsubdir = cask.staged_path.join("subdir").tap(&:mkpath) FileUtils.mv(source_path, appsubdir) - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(appsubdir.join("Caffeine.app")).not_to exist @@ -53,9 +49,7 @@ describe Hbc::Artifact::App, :cask do staged_app_copy = source_path.sub("Caffeine.app", "Caffeine Deluxe.app") FileUtils.cp_r source_path, staged_app_copy - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(source_path).not_to exist diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index 54e6ae5bf..0add472e2 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -16,9 +16,7 @@ describe Hbc::Artifact::App, :cask do describe "install_phase" do it "installs the given app using the proper target directory" do - shutup do - install_phase - end + install_phase expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -39,9 +37,7 @@ describe Hbc::Artifact::App, :cask do appsubdir = cask.staged_path.join("subdir").tap(&:mkpath) FileUtils.mv(source_path, appsubdir) - shutup do - install_phase - end + install_phase expect(target_path).to be_a_directory expect(appsubdir.join("Caffeine.app")).not_to exist @@ -52,9 +48,7 @@ describe Hbc::Artifact::App, :cask do staged_app_copy = source_path.sub("Caffeine.app", "Caffeine Deluxe.app") FileUtils.cp_r source_path, staged_app_copy - shutup do - install_phase - end + install_phase expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -201,15 +195,11 @@ describe Hbc::Artifact::App, :cask do describe "uninstall_phase" do it "deletes managed apps" do - shutup do - install_phase - end + install_phase expect(target_path).to exist - shutup do - uninstall_phase - end + uninstall_phase expect(target_path).not_to exist end @@ -225,9 +215,7 @@ describe Hbc::Artifact::App, :cask do describe "app is correctly installed" do it "returns the path to the app" do - shutup do - install_phase - end + install_phase expect(contents).to eq(["#{target_path} (#{target_path.abv})"]) end diff --git a/Library/Homebrew/test/cask/artifact/binary_spec.rb b/Library/Homebrew/test/cask/artifact/binary_spec.rb index f9b5f5b42..ce00e3935 100644 --- a/Library/Homebrew/test/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/test/cask/artifact/binary_spec.rb @@ -1,9 +1,7 @@ describe Hbc::Artifact::Binary, :cask do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-binary.rb").tap do |cask| - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end } let(:expected_path) { Hbc.binarydir.join("binary") } @@ -22,18 +20,14 @@ describe Hbc::Artifact::Binary, :cask do } it "doesn't link the binary when --no-binaries is specified" do - shutup do - Hbc::Installer.new(cask, binaries: false).install - end - + Hbc::Installer.new(cask, binaries: false).install expect(expected_path).not_to exist end end it "links the binary to the proper directory" do - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase + expect(expected_path).to be_a_symlink expect(expected_path.readlink).to exist end @@ -41,9 +35,7 @@ describe Hbc::Artifact::Binary, :cask do context "when the binary is not executable" do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-non-executable-binary.rb").tap do |cask| - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end } @@ -53,9 +45,7 @@ describe Hbc::Artifact::Binary, :cask do expect(FileUtils).to receive(:chmod) .with("+x", cask.staged_path.join("naked_non_executable")).and_call_original - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase expect(expected_path).to be_a_symlink expect(expected_path.readlink).to be_executable @@ -66,9 +56,7 @@ describe Hbc::Artifact::Binary, :cask do FileUtils.touch expected_path expect { - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase }.to raise_error(Hbc::CaskError) expect(expected_path).not_to be :symlink? @@ -77,9 +65,7 @@ describe Hbc::Artifact::Binary, :cask do it "clobbers an existing symlink" do expected_path.make_symlink("/tmp") - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase expect(File.readlink(expected_path)).not_to eq("/tmp") end @@ -87,9 +73,7 @@ describe Hbc::Artifact::Binary, :cask do it "creates parent directory if it doesn't exist" do FileUtils.rmdir Hbc.binarydir - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase expect(expected_path.exist?).to be true end @@ -97,17 +81,13 @@ describe Hbc::Artifact::Binary, :cask do context "binary is inside an app package" do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-embedded-binary.rb").tap do |cask| - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end } it "links the binary to the proper directory" do - shutup do - Hbc::Artifact::App.new(cask).install_phase - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::App.new(cask).install_phase + Hbc::Artifact::Binary.new(cask).install_phase expect(expected_path).to be_a_symlink expect(expected_path.readlink).to exist diff --git a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb index b383e2d4e..cb2ef9850 100644 --- a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb +++ b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb @@ -21,9 +21,7 @@ describe Hbc::Artifact::Artifact, :cask do end it "moves the artifact to the proper directory" do - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -33,9 +31,7 @@ describe Hbc::Artifact::Artifact, :cask do target_path.mkpath expect { - shutup do - install_phase.call - end + install_phase.call }.to raise_error(Hbc::CaskError) expect(source_path).to be_a_directory diff --git a/Library/Homebrew/test/cask/artifact/nested_container_spec.rb b/Library/Homebrew/test/cask/artifact/nested_container_spec.rb index 3e9a549ea..be7ba5ff8 100644 --- a/Library/Homebrew/test/cask/artifact/nested_container_spec.rb +++ b/Library/Homebrew/test/cask/artifact/nested_container_spec.rb @@ -5,9 +5,7 @@ describe Hbc::Artifact::NestedContainer, :cask do InstallHelper.install_without_artifacts(c) end - shutup do - Hbc::Artifact::NestedContainer.new(cask).install_phase - end + Hbc::Artifact::NestedContainer.new(cask).install_phase expect(cask.staged_path.join("MyNestedApp.app")).to be_a_directory end diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index 249439900..3e62616ea 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -3,9 +3,7 @@ describe Hbc::Artifact::Pkg, :cask do let(:fake_system_command) { class_double(Hbc::SystemCommand) } before(:each) do - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end describe "install_phase" do @@ -19,9 +17,7 @@ describe Hbc::Artifact::Pkg, :cask do print_stdout: true, ) - shutup do - pkg.install_phase - end + pkg.install_phase end end @@ -61,9 +57,7 @@ describe Hbc::Artifact::Pkg, :cask do print_stdout: true, ) - shutup do - pkg.install_phase - end + pkg.install_phase end end end diff --git a/Library/Homebrew/test/cask/artifact/suite_spec.rb b/Library/Homebrew/test/cask/artifact/suite_spec.rb index eca6b6f17..8c217a9e0 100644 --- a/Library/Homebrew/test/cask/artifact/suite_spec.rb +++ b/Library/Homebrew/test/cask/artifact/suite_spec.rb @@ -11,9 +11,7 @@ describe Hbc::Artifact::Suite, :cask do end it "creates a suite containing the expected app" do - shutup do - install_phase.call - end + install_phase.call expect(target_path.join("Caffeine.app")).to exist end @@ -22,9 +20,7 @@ describe Hbc::Artifact::Suite, :cask do target_path.mkpath expect { - shutup do - install_phase.call - end + install_phase.call }.to raise_error(Hbc::CaskError) expect(source_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 9db22b2a3..a1fdd3b74 100644 --- a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb +++ b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb @@ -17,9 +17,7 @@ describe Hbc::Artifact::App, :cask do end it "installs both apps using the proper target directory" do - shutup do - install_phase.call - end + install_phase.call expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist @@ -32,9 +30,7 @@ describe Hbc::Artifact::App, :cask do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-two-apps-subdir.rb") } it "installs both apps using the proper target directory" do - shutup do - install_phase.call - end + install_phase.call expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist @@ -47,9 +43,7 @@ describe Hbc::Artifact::App, :cask do it "only uses apps when they are specified" do FileUtils.cp_r source_path_mini, source_path_mini.sub("Caffeine Mini.app", "Caffeine Deluxe.app") - shutup do - install_phase.call - end + install_phase.call expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist 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 f88aaa49d..8cd0b1e41 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb @@ -5,10 +5,8 @@ describe Hbc::Artifact::Zap, :cask do Hbc::Artifact::Zap.new(cask) } - before do - shutup do - InstallHelper.install_without_artifacts(cask) - end + before(:each) do + InstallHelper.install_without_artifacts(cask) end describe "#uninstall_phase" do 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 b84c1fd00..0e522bc21 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb @@ -3,11 +3,7 @@ shared_examples "#uninstall_phase or #zap_phase" do let(:artifact) { described_class.new(cask, command: fake_system_command) } let(:fake_system_command) { Hbc::FakeSystemCommand } - subject do - shutup do - artifact.public_send(:"#{artifact_name}_phase") - end - end + subject { artifact.public_send(:"#{artifact_name}_phase") } context "using :launchctl" do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-#{artifact_name}-launchctl.rb") } diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb index 3736f3c01..a6ecc207f 100644 --- a/Library/Homebrew/test/cask/cask_spec.rb +++ b/Library/Homebrew/test/cask/cask_spec.rb @@ -39,9 +39,7 @@ describe Hbc::Cask, :cask do end it "returns an instance of the Cask from a url" do - c = shutup do - Hbc::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") - end + c = Hbc::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") expect(c).to be_kind_of(Hbc::Cask) expect(c.token).to eq("local-caffeine") end @@ -49,9 +47,8 @@ describe Hbc::Cask, :cask do it "raises an error when failing to download a Cask from a url" do expect { url = "file://#{tap_path}/Casks/notacask.rb" - shutup do - Hbc::CaskLoader.load(url) - end + + Hbc::CaskLoader.load(url) }.to raise_error(Hbc::CaskUnavailableError) end diff --git a/Library/Homebrew/test/cask/cli/fetch_spec.rb b/Library/Homebrew/test/cask/cli/fetch_spec.rb index 54bdfc0c8..f71c23fb6 100644 --- a/Library/Homebrew/test/cask/cli/fetch_spec.rb +++ b/Library/Homebrew/test/cask/cli/fetch_spec.rb @@ -8,9 +8,7 @@ describe Hbc::CLI::Fetch, :cask do } it "allows download the installer of a Cask" do - shutup do - Hbc::CLI::Fetch.run("local-transmission", "local-caffeine") - end + Hbc::CLI::Fetch.run("local-transmission", "local-caffeine") expect(Hbc::CurlDownloadStrategy.new(local_transmission).cached_location).to exist expect(Hbc::CurlDownloadStrategy.new(local_caffeine).cached_location).to exist end @@ -18,31 +16,23 @@ describe Hbc::CLI::Fetch, :cask do it "prevents double fetch (without nuking existing installation)" do download_stategy = Hbc::CurlDownloadStrategy.new(local_transmission) - shutup do - Hbc::Download.new(local_transmission).perform - end + Hbc::Download.new(local_transmission).perform old_ctime = File.stat(download_stategy.cached_location).ctime - shutup do - Hbc::CLI::Fetch.run("local-transmission") - end + Hbc::CLI::Fetch.run("local-transmission") new_ctime = File.stat(download_stategy.cached_location).ctime expect(old_ctime.to_i).to eq(new_ctime.to_i) end it "allows double fetch with --force" do - shutup do - Hbc::Download.new(local_transmission).perform - end + Hbc::Download.new(local_transmission).perform download_stategy = Hbc::CurlDownloadStrategy.new(local_transmission) old_ctime = File.stat(download_stategy.cached_location).ctime sleep(1) - shutup do - Hbc::CLI::Fetch.run("local-transmission", "--force") - end + Hbc::CLI::Fetch.run("local-transmission", "--force") download_stategy = Hbc::CurlDownloadStrategy.new(local_transmission) new_ctime = File.stat(download_stategy.cached_location).ctime @@ -51,9 +41,7 @@ describe Hbc::CLI::Fetch, :cask do it "properly handles Casks that are not present" do expect { - shutup do - Hbc::CLI::Fetch.run("notacask") - end + Hbc::CLI::Fetch.run("notacask") }.to raise_error(Hbc::CaskError, "Fetch incomplete.") end diff --git a/Library/Homebrew/test/cask/cli/install_spec.rb b/Library/Homebrew/test/cask/cli/install_spec.rb index cf69b5d86..64feacce9 100644 --- a/Library/Homebrew/test/cask/cli/install_spec.rb +++ b/Library/Homebrew/test/cask/cli/install_spec.rb @@ -14,9 +14,7 @@ describe Hbc::CLI::Install, :cask do end it "allows staging and activation of multiple Casks at once" do - shutup do - Hbc::CLI::Install.run("local-transmission", "local-caffeine") - end + Hbc::CLI::Install.run("local-transmission", "local-caffeine") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed expect(Hbc.appdir.join("Transmission.app")).to be_a_directory @@ -25,19 +23,13 @@ describe Hbc::CLI::Install, :cask do end it "skips double install (without nuking existing installation)" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") + Hbc::CLI::Install.run("local-transmission") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed end it "prints a warning message on double install" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") expect { Hbc::CLI::Install.run("local-transmission") @@ -45,9 +37,7 @@ describe Hbc::CLI::Install, :cask do end it "allows double install with --force" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") expect { expect { @@ -57,9 +47,7 @@ describe Hbc::CLI::Install, :cask do end it "skips dependencies with --skip-cask-deps" do - shutup do - Hbc::CLI::Install.run("with-depends-on-cask-multiple", "--skip-cask-deps") - end + Hbc::CLI::Install.run("with-depends-on-cask-multiple", "--skip-cask-deps") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-depends-on-cask-multiple.rb")).to be_installed expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")).not_to be_installed expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).not_to be_installed @@ -67,9 +55,7 @@ describe Hbc::CLI::Install, :cask do it "properly handles Casks that are not present" do expect { - shutup do - Hbc::CLI::Install.run("notacask") - end + Hbc::CLI::Install.run("notacask") }.to raise_error(Hbc::CaskError, "Install incomplete.") end diff --git a/Library/Homebrew/test/cask/cli/list_spec.rb b/Library/Homebrew/test/cask/cli/list_spec.rb index d3fee7306..ecca3035f 100644 --- a/Library/Homebrew/test/cask/cli/list_spec.rb +++ b/Library/Homebrew/test/cask/cli/list_spec.rb @@ -48,9 +48,7 @@ describe Hbc::CLI::List, :cask do it "lists the installed files for those Casks" do casks.each(&InstallHelper.method(:install_without_artifacts_with_caskfile)) - shutup do - Hbc::Artifact::App.new(transmission).install_phase - end + Hbc::Artifact::App.new(transmission).install_phase expect { Hbc::CLI::List.run("local-transmission", "local-caffeine") diff --git a/Library/Homebrew/test/cask/cli/outdated_spec.rb b/Library/Homebrew/test/cask/cli/outdated_spec.rb index 3d9e9bdeb..946092f89 100644 --- a/Library/Homebrew/test/cask/cli/outdated_spec.rb +++ b/Library/Homebrew/test/cask/cli/outdated_spec.rb @@ -10,9 +10,8 @@ describe Hbc::CLI::Outdated, :cask do end before do - shutup do - installed.each { |cask| InstallHelper.install_with_caskfile(cask) } - end + installed.each { |cask| InstallHelper.install_with_caskfile(cask) } + allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end diff --git a/Library/Homebrew/test/cask/cli/reinstall_spec.rb b/Library/Homebrew/test/cask/cli/reinstall_spec.rb index 8885fa199..3a9c3e2f5 100644 --- a/Library/Homebrew/test/cask/cli/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/reinstall_spec.rb @@ -2,9 +2,7 @@ describe Hbc::CLI::Reinstall, :cask do it "displays the reinstallation progress" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install output = Regexp.new <<-EOS.undent ==> Downloading file:.*caffeine.zip @@ -23,23 +21,18 @@ describe Hbc::CLI::Reinstall, :cask do end it "allows reinstalling a Cask" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") + expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed - shutup do - Hbc::CLI::Reinstall.run("local-transmission") - end + Hbc::CLI::Reinstall.run("local-transmission") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed end it "allows reinstalling a non installed Cask" do expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).not_to be_installed - shutup do - Hbc::CLI::Reinstall.run("local-transmission") - end + Hbc::CLI::Reinstall.run("local-transmission") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed end end diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb index f43610767..e237ad464 100644 --- a/Library/Homebrew/test/cask/cli/search_spec.rb +++ b/Library/Homebrew/test/cask/cli/search_spec.rb @@ -75,9 +75,7 @@ describe Hbc::CLI::Search, :cask do end it "highlights installed packages" do - shutup do - Hbc::CLI::Install.run("local-caffeine") - end + Hbc::CLI::Install.run("local-caffeine") expect(Hbc::CLI::Search.highlight_installed("local-caffeine")).to eq(pretty_installed("local-caffeine")) end diff --git a/Library/Homebrew/test/cask/cli/style_spec.rb b/Library/Homebrew/test/cask/cli/style_spec.rb index 15507f410..2007b87d7 100644 --- a/Library/Homebrew/test/cask/cli/style_spec.rb +++ b/Library/Homebrew/test/cask/cli/style_spec.rb @@ -5,9 +5,7 @@ describe Hbc::CLI::Style, :cask do let(:args) { [] } let(:cli) { described_class.new(*args) } - around do |example| - shutup { example.run } - end + around(&:run) describe "#run" do subject { cli.run } diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb index cc640fad7..1a1c57e88 100644 --- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb @@ -2,9 +2,7 @@ describe Hbc::CLI::Uninstall, :cask do it "displays the uninstallation progress" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install output = Regexp.new <<-EOS.undent ==> Uninstalling Cask local-caffeine @@ -30,9 +28,7 @@ describe Hbc::CLI::Uninstall, :cask do it "tries anyway on a non-present Cask when --force is given" do expect { - shutup do - Hbc::CLI::Uninstall.run("local-caffeine", "--force") - end + Hbc::CLI::Uninstall.run("local-caffeine", "--force") }.not_to raise_error end @@ -40,17 +36,13 @@ describe Hbc::CLI::Uninstall, :cask do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") transmission = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb") - shutup do - Hbc::Installer.new(caffeine).install - Hbc::Installer.new(transmission).install - end + Hbc::Installer.new(caffeine).install + Hbc::Installer.new(transmission).install expect(caffeine).to be_installed expect(transmission).to be_installed - shutup do - Hbc::CLI::Uninstall.run("local-caffeine", "local-transmission") - end + Hbc::CLI::Uninstall.run("local-caffeine", "local-transmission") expect(caffeine).not_to be_installed expect(Hbc.appdir.join("Transmission.app")).not_to exist @@ -61,17 +53,13 @@ describe Hbc::CLI::Uninstall, :cask do it "calls `uninstall` before removing artifacts" do cask = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-uninstall-script-app.rb") - shutup do - Hbc::Installer.new(cask).install - end + Hbc::Installer.new(cask).install expect(cask).to be_installed expect(Hbc.appdir.join("MyFancyApp.app")).to exist expect { - shutup do - Hbc::CLI::Uninstall.run("with-uninstall-script-app") - end + Hbc::CLI::Uninstall.run("with-uninstall-script-app") }.not_to raise_error expect(cask).not_to be_installed @@ -81,24 +69,20 @@ describe Hbc::CLI::Uninstall, :cask do it "can uninstall Casks when the uninstall script is missing, but only when using `--force`" do cask = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-uninstall-script-app.rb") - shutup do - Hbc::Installer.new(cask).install - end + Hbc::Installer.new(cask).install expect(cask).to be_installed Hbc.appdir.join("MyFancyApp.app").rmtree - expect { shutup { Hbc::CLI::Uninstall.run("with-uninstall-script-app") } } + expect { Hbc::CLI::Uninstall.run("with-uninstall-script-app") } .to output(/does not exist/).to_stderr .and raise_error(Hbc::CaskError, "Uninstall incomplete.") expect(cask).to be_installed expect { - shutup do - Hbc::CLI::Uninstall.run("with-uninstall-script-app", "--force") - end + Hbc::CLI::Uninstall.run("with-uninstall-script-app", "--force") }.not_to raise_error expect(cask).not_to be_installed @@ -131,17 +115,13 @@ describe Hbc::CLI::Uninstall, :cask do end it "uninstalls one version at a time" do - shutup do - Hbc::CLI::Uninstall.run("versioned-cask") - end + Hbc::CLI::Uninstall.run("versioned-cask") expect(caskroom_path.join(first_installed_version)).to exist expect(caskroom_path.join(last_installed_version)).not_to exist expect(caskroom_path).to exist - shutup do - Hbc::CLI::Uninstall.run("versioned-cask") - end + Hbc::CLI::Uninstall.run("versioned-cask") expect(caskroom_path.join(first_installed_version)).not_to exist expect(caskroom_path).not_to exist @@ -180,9 +160,7 @@ describe Hbc::CLI::Uninstall, :cask do end it "can still uninstall those Casks" do - shutup do - Hbc::CLI::Uninstall.run("ive-been-renamed") - end + Hbc::CLI::Uninstall.run("ive-been-renamed") expect(app).not_to exist expect(caskroom_path).not_to exist diff --git a/Library/Homebrew/test/cask/cli/zap_spec.rb b/Library/Homebrew/test/cask/cli/zap_spec.rb index e39ca61f8..fdc5b4125 100644 --- a/Library/Homebrew/test/cask/cli/zap_spec.rb +++ b/Library/Homebrew/test/cask/cli/zap_spec.rb @@ -9,17 +9,13 @@ describe Hbc::CLI::Zap, :cask do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") transmission = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb") - shutup do - Hbc::Installer.new(caffeine).install - Hbc::Installer.new(transmission).install - end + Hbc::Installer.new(caffeine).install + Hbc::Installer.new(transmission).install expect(caffeine).to be_installed expect(transmission).to be_installed - shutup do - Hbc::CLI::Zap.run("local-caffeine", "local-transmission") - end + Hbc::CLI::Zap.run("local-caffeine", "local-transmission") expect(caffeine).not_to be_installed expect(Hbc.appdir.join("Caffeine.app")).not_to be_a_symlink @@ -33,9 +29,7 @@ describe Hbc::CLI::Zap, :cask do # it "dispatches both uninstall and zap stanzas" do # with_zap = Hbc::CaskLoader.load('with-zap') # - # shutup do - # Hbc::Installer.new(with_zap).install - # end + # Hbc::Installer.new(with_zap).install # # with_zap.must_be :installed? # @@ -48,9 +42,8 @@ describe Hbc::CLI::Zap, :cask do # Hbc::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/bin/rm', '-rf', '--', # Pathname.new('~/Library/Preferences/my.fancy.app.plist').expand_path]) # - # shutup do - # Hbc::CLI::Zap.run('with-zap') - # end + # Hbc::CLI::Zap.run('with-zap') + # # with_zap.wont_be :installed? # end diff --git a/Library/Homebrew/test/cask/cli_spec.rb b/Library/Homebrew/test/cask/cli_spec.rb index 51258c580..4a61e0088 100644 --- a/Library/Homebrew/test/cask/cli_spec.rb +++ b/Library/Homebrew/test/cask/cli_spec.rb @@ -17,7 +17,7 @@ describe Hbc::CLI, :cask do cli = described_class.new("--language=en") expect(cli).to receive(:detect_command_and_arguments).with(no_args) expect(cli).to receive(:exit).with(1) - shutup { cli.run } + cli.run end context "when no option is specified" do @@ -36,10 +36,6 @@ describe Hbc::CLI, :cask do allow(noop_command).to receive(:run) end - around do |example| - shutup { example.run } - end - it "passes `--version` along to the subcommand" do version_command = double("CLI::Version") allow(described_class).to receive(:lookup_command).with("--version").and_return(version_command) diff --git a/Library/Homebrew/test/cask/container/naked_spec.rb b/Library/Homebrew/test/cask/container/naked_spec.rb index eb30ef81a..1ccdf4ef4 100644 --- a/Library/Homebrew/test/cask/container/naked_spec.rb +++ b/Library/Homebrew/test/cask/container/naked_spec.rb @@ -13,9 +13,7 @@ describe Hbc::Container::Naked, :cask do container = Hbc::Container::Naked.new(cask, path, Hbc::FakeSystemCommand) expect { - shutup do - container.extract - end + container.extract }.not_to raise_error expect(Hbc::FakeSystemCommand.system_calls[expected_command]).to eq(1) diff --git a/Library/Homebrew/test/cask/depends_on_spec.rb b/Library/Homebrew/test/cask/depends_on_spec.rb index 4b78820ce..c603cf6e1 100644 --- a/Library/Homebrew/test/cask/depends_on_spec.rb +++ b/Library/Homebrew/test/cask/depends_on_spec.rb @@ -3,9 +3,7 @@ describe "Satisfy Dependencies and Requirements", :cask do subject { lambda do - shutup do - Hbc::Installer.new(cask).install - end + Hbc::Installer.new(cask).install end } diff --git a/Library/Homebrew/test/cask/download_strategy_spec.rb b/Library/Homebrew/test/cask/download_strategy_spec.rb index 27f1ad410..222352c07 100644 --- a/Library/Homebrew/test/cask/download_strategy_spec.rb +++ b/Library/Homebrew/test/cask/download_strategy_spec.rb @@ -23,9 +23,7 @@ describe "download strategies", :cask do it "calls curl with default arguments for a simple Cask" do allow(downloader).to receive(:curl) - shutup do - downloader.fetch - end + downloader.fetch expect(downloader).to have_received(:curl).with( cask.url.to_s, @@ -41,9 +39,7 @@ describe "download strategies", :cask do curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-A", "Mozilla/25.0.1"]) end @@ -56,9 +52,7 @@ describe "download strategies", :cask do curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-A", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io"]) end @@ -78,9 +72,7 @@ describe "download strategies", :cask do curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-b", "coo=kie;mon=ster"]) end @@ -93,9 +85,7 @@ describe "download strategies", :cask do curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-e", "http://somehost/also"]) end @@ -124,9 +114,7 @@ describe "download strategies", :cask do curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-d", "form=data"]) expect(curl_args.each_cons(2)).to include(["-d", "is=good"]) @@ -140,9 +128,7 @@ describe "download strategies", :cask do curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-X", "POST"]) end @@ -161,18 +147,14 @@ describe "download strategies", :cask do allow(downloader).to receive(:compress) allow(downloader).to receive(:fetch_repo) - retval = shutup { downloader.fetch } - - expect(retval).to equal(downloader.tarball_path) + expect(downloader.fetch).to equal(downloader.tarball_path) end it "calls fetch_repo with default arguments for a simple Cask" do allow(downloader).to receive(:compress) allow(downloader).to receive(:fetch_repo) - shutup do - downloader.fetch - end + downloader.fetch expect(downloader).to have_received(:fetch_repo).with( downloader.cached_location, @@ -183,9 +165,7 @@ describe "download strategies", :cask do it "calls svn with default arguments for a simple Cask" do allow(downloader).to receive(:compress) - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/svn", @@ -211,9 +191,7 @@ describe "download strategies", :cask do it "adds svn arguments for :trust_cert" do allow(downloader).to receive(:compress) - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/svn", @@ -242,9 +220,7 @@ describe "download strategies", :cask do it "adds svn arguments for :revision" do allow(downloader).to receive(:compress) - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/svn", @@ -269,9 +245,7 @@ describe "download strategies", :cask do downloader.cached_location.mkdir } - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/tar", @@ -299,7 +273,7 @@ describe "download strategies", :cask do # FileUtils.touch(target.join('empty_file.txt')) # File.utime(1000,1000,target.join('empty_file.txt')) # end - # expect(shutup { downloader.fetch }).to equal(downloader.tarball_path) + # expect(downloader.fetch).to equal(downloader.tarball_path) # d = Hbc::Download.new(cask) # d.send(:_check_sums, downloader.tarball_path, cask.sums) # end diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index 5849f581b..7f2207a87 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -36,9 +36,7 @@ describe Hbc::DSL, :cask do it "will simply warn, not throw an exception" do expect { - shutup do - attempt_unknown_method.call - end + attempt_unknown_method.call }.not_to raise_error end end @@ -78,12 +76,10 @@ describe Hbc::DSL, :cask do it "may use deprecated DSL version hash syntax" do allow(ENV).to receive(:[]).with("HOMEBREW_DEVELOPER").and_return(nil) - shutup do - expect(cask.token).to eq("with-dsl-version") - expect(cask.url.to_s).to eq("http://example.com/TestCask.dmg") - expect(cask.homepage).to eq("http://example.com/") - expect(cask.version.to_s).to eq("1.2.3") - end + expect(cask.token).to eq("with-dsl-version") + expect(cask.url.to_s).to eq("http://example.com/TestCask.dmg") + expect(cask.homepage).to eq("http://example.com/") + expect(cask.version.to_s).to eq("1.2.3") end end end diff --git a/Library/Homebrew/test/cask/installer_spec.rb b/Library/Homebrew/test/cask/installer_spec.rb index b5a445aec..6f7c6d3d7 100644 --- a/Library/Homebrew/test/cask/installer_spec.rb +++ b/Library/Homebrew/test/cask/installer_spec.rb @@ -7,9 +7,7 @@ describe Hbc::Installer, :cask do it "downloads and installs a nice fresh Cask" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).to be_a_directory expect(Hbc.appdir.join("Caffeine.app")).to be_a_directory @@ -18,9 +16,7 @@ describe Hbc::Installer, :cask do it "works with dmg-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-dmg.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-dmg", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -29,9 +25,7 @@ describe Hbc::Installer, :cask do it "works with tar-gz-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-tar-gz.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-tar-gz", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -40,9 +34,7 @@ describe Hbc::Installer, :cask do it "works with xar-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-xar.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-xar", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -51,9 +43,7 @@ describe Hbc::Installer, :cask do it "works with pure bzip2-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-bzip2.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-bzip2", asset.version)).to be_a_directory expect(Hbc.appdir.join("container-bzip2--#{asset.version}")).to be_a_file @@ -62,9 +52,7 @@ describe Hbc::Installer, :cask do it "works with pure gzip-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-gzip.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-gzip", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -73,27 +61,21 @@ describe Hbc::Installer, :cask do it "blows up on a bad checksum" do bad_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/bad-checksum.rb") expect { - shutup do - Hbc::Installer.new(bad_checksum).install - end + Hbc::Installer.new(bad_checksum).install }.to raise_error(Hbc::CaskSha256MismatchError) end it "blows up on a missing checksum" do missing_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/missing-checksum.rb") expect { - shutup do - Hbc::Installer.new(missing_checksum).install - end + Hbc::Installer.new(missing_checksum).install }.to raise_error(Hbc::CaskSha256MissingError) end it "installs fine if sha256 :no_check is used" do no_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/no-checksum.rb") - shutup do - Hbc::Installer.new(no_checksum).install - end + Hbc::Installer.new(no_checksum).install expect(no_checksum).to be_installed end @@ -101,18 +83,14 @@ describe Hbc::Installer, :cask do it "fails to install if sha256 :no_check is used with --require-sha" do no_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/no-checksum.rb") expect { - shutup do - Hbc::Installer.new(no_checksum, require_sha: true).install - end + Hbc::Installer.new(no_checksum, require_sha: true).install }.to raise_error(Hbc::CaskNoShasumError) end it "installs fine if sha256 :no_check is used with --require-sha and --force" do no_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/no-checksum.rb") - shutup do - Hbc::Installer.new(no_checksum, require_sha: true, force: true).install - end + Hbc::Installer.new(no_checksum, require_sha: true, force: true).install expect(no_checksum).to be_installed end @@ -140,9 +118,7 @@ describe Hbc::Installer, :cask do it "does not extract __MACOSX directories from zips" do with_macosx_dir = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-macosx-dir.rb") - shutup do - Hbc::Installer.new(with_macosx_dir).install - end + Hbc::Installer.new(with_macosx_dir).install expect(with_macosx_dir.staged_path.join("__MACOSX")).not_to be_a_directory end @@ -152,14 +128,10 @@ describe Hbc::Installer, :cask do expect(with_auto_updates).not_to be_installed - shutup do - Hbc::Installer.new(with_auto_updates).install - end + Hbc::Installer.new(with_auto_updates).install expect { - shutup do - Hbc::Installer.new(with_auto_updates, force: true).install - end + Hbc::Installer.new(with_auto_updates, force: true).install }.not_to raise_error end @@ -171,9 +143,7 @@ describe Hbc::Installer, :cask do installer = Hbc::Installer.new(transmission) - shutup do - installer.install - end + installer.install expect { installer.install @@ -185,21 +155,17 @@ describe Hbc::Installer, :cask do expect(transmission).not_to be_installed - shutup do - Hbc::Installer.new(transmission).install - end + Hbc::Installer.new(transmission).install - shutup do + expect { Hbc::Installer.new(transmission, force: true).install - end # wont_raise + }.not_to raise_error end it "works naked-pkg-based Casks" do naked_pkg = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-pkg.rb") - shutup do - Hbc::Installer.new(naked_pkg).install - end + Hbc::Installer.new(naked_pkg).install expect(Hbc.caskroom.join("container-pkg", naked_pkg.version, "container.pkg")).to be_a_file end @@ -207,9 +173,7 @@ describe Hbc::Installer, :cask do it "works properly with an overridden container :type" do naked_executable = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/naked-executable.rb") - shutup do - Hbc::Installer.new(naked_executable).install - end + Hbc::Installer.new(naked_executable).install expect(Hbc.caskroom.join("naked-executable", naked_executable.version, "naked_executable")).to be_a_file end @@ -217,9 +181,7 @@ describe Hbc::Installer, :cask do it "works fine with a nested container" do nested_app = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/nested-app.rb") - shutup do - Hbc::Installer.new(nested_app).install - end + Hbc::Installer.new(nested_app).install expect(Hbc.appdir.join("MyNestedApp.app")).to be_a_directory end @@ -227,9 +189,7 @@ describe Hbc::Installer, :cask do it "generates and finds a timestamped metadata directory for an installed Cask" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::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) @@ -238,9 +198,7 @@ describe Hbc::Installer, :cask do it "generates and finds a metadata subdirectory for an installed Cask" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install subdir_name = "Casks" m_subdir = caffeine.metadata_subdir(subdir_name, timestamp: :now, create: true) @@ -253,10 +211,8 @@ describe Hbc::Installer, :cask do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") installer = Hbc::Installer.new(caffeine) - shutup do - installer.install - installer.uninstall - end + installer.install + installer.uninstall expect(Hbc.caskroom.join("local-caffeine", caffeine.version, "Caffeine.app")).not_to be_a_directory expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).not_to be_a_directory @@ -267,9 +223,7 @@ describe Hbc::Installer, :cask do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") mutated_version = caffeine.version + ".1" - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).to be_a_directory expect(Hbc.caskroom.join("local-caffeine", mutated_version)).not_to be_a_directory @@ -277,9 +231,7 @@ describe Hbc::Installer, :cask do expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).not_to be_a_directory expect(Hbc.caskroom.join("local-caffeine", mutated_version)).to be_a_directory - shutup do - Hbc::Installer.new(caffeine, force: true).uninstall - end + Hbc::Installer.new(caffeine, force: true).uninstall expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).not_to be_a_directory expect(Hbc.caskroom.join("local-caffeine", mutated_version)).not_to be_a_directory diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index e507ceda0..56061c9fd 100644 --- a/Library/Homebrew/test/cask/pkg_spec.rb +++ b/Library/Homebrew/test/cask/pkg_spec.rb @@ -88,9 +88,7 @@ describe Hbc::Pkg, :cask do allow(pkg).to receive(:root).and_return(fake_root) allow(pkg).to receive(:forget) - shutup do - pkg.uninstall - end + pkg.uninstall expect(fake_dir).to be_a_directory expect(fake_file).not_to be_a_file diff --git a/Library/Homebrew/test/cask/staged_spec.rb b/Library/Homebrew/test/cask/staged_spec.rb index 670775b7a..73a909f35 100644 --- a/Library/Homebrew/test/cask/staged_spec.rb +++ b/Library/Homebrew/test/cask/staged_spec.rb @@ -6,10 +6,7 @@ describe "Operations on staged Casks", :cask do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb") } let(:installer) { Hbc::Installer.new(cask) } it "fetches the bundle ID from a staged cask" do - shutup do - installer.install - end - + installer.install expect(installer.bundle_identifier).to eq("org.m0k.transmission") end end diff --git a/Library/Homebrew/test/cask/system_command_spec.rb b/Library/Homebrew/test/cask/system_command_spec.rb index 8d1180bea..ba5ea03fc 100644 --- a/Library/Homebrew/test/cask/system_command_spec.rb +++ b/Library/Homebrew/test/cask/system_command_spec.rb @@ -56,7 +56,7 @@ describe Hbc::SystemCommand, :cask do shared_examples "it returns '1 2 3 4 5 6'" do describe "its result" do - subject { shutup { described_class.run(command, options) } } + subject { described_class.run(command, options) } it { is_expected.to be_a_success } its(:stdout) { is_expected.to eq([1, 3, 5, nil].join("\n")) } @@ -132,7 +132,7 @@ describe Hbc::SystemCommand, :cask do it "returns without deadlocking" do wait(15).for { - shutup { described_class.run(command, options) } + described_class.run(command, options) }.to be_a_success end end diff --git a/Library/Homebrew/test/cask/verify/checksum_spec.rb b/Library/Homebrew/test/cask/verify/checksum_spec.rb index 4b8543d2b..117b9089d 100644 --- a/Library/Homebrew/test/cask/verify/checksum_spec.rb +++ b/Library/Homebrew/test/cask/verify/checksum_spec.rb @@ -7,10 +7,6 @@ describe Hbc::Verify::Checksum, :cask do allow(cask).to receive(:sha256).and_return(sha256) end - around do |example| - shutup { example.run } - end - describe ".me?" do subject { described_class.me?(cask) } |
