diff options
Diffstat (limited to 'Library/Homebrew/test/cask/artifact/binary_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/cask/artifact/binary_spec.rb | 44 |
1 files changed, 12 insertions, 32 deletions
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 |
