aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask
diff options
context:
space:
mode:
authorMarkus Reiter2017-05-19 19:13:23 +0200
committerMarkus Reiter2017-05-22 02:51:16 +0200
commit9e821863d0ed97254bbae314b97af18d2f09cdfa (patch)
treeec0f30fc60dab1b4d3de17a8fc163de6658913ea /Library/Homebrew/test/cask
parent8f068a356dfe4769905d2487533b9e8124287098 (diff)
downloadbrew-9e821863d0ed97254bbae314b97af18d2f09cdfa.tar.bz2
Pass along `CLI::Binaries`.
Diffstat (limited to 'Library/Homebrew/test/cask')
-rw-r--r--Library/Homebrew/test/cask/artifact/binary_spec.rb30
1 files changed, 14 insertions, 16 deletions
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