From 9e821863d0ed97254bbae314b97af18d2f09cdfa Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 19 May 2017 19:13:23 +0200 Subject: Pass along `CLI::Binaries`. --- Library/Homebrew/test/cask/artifact/binary_spec.rb | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/cask/artifact/binary_spec.rb b/Library/Homebrew/test/cask/artifact/binary_spec.rb index ee62e6439..f9b5f5b42 100644 --- a/Library/Homebrew/test/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/test/cask/artifact/binary_spec.rb @@ -16,6 +16,20 @@ describe Hbc::Artifact::Binary, :cask do FileUtils.rm expected_path if expected_path.exist? end + context "when --no-binaries is specified" do + let(:cask) { + Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-binary.rb") + } + + it "doesn't link the binary when --no-binaries is specified" do + shutup do + Hbc::Installer.new(cask, binaries: false).install + end + + 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 @@ -70,22 +84,6 @@ describe Hbc::Artifact::Binary, :cask do expect(File.readlink(expected_path)).not_to eq("/tmp") end - it "respects --no-binaries flag" do - begin - Hbc::CLI.binaries = false - - expect(Hbc::CLI).not_to be_binaries - - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end - - expect(expected_path.exist?).to be false - ensure - Hbc::CLI.binaries = true - end - end - it "creates parent directory if it doesn't exist" do FileUtils.rmdir Hbc.binarydir -- cgit v1.2.3