aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/dev-cmd
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 04:55:07 +0100
committerGitHub2017-02-25 04:55:07 +0100
commit3ca9a3c502ea6e5680bd635167c4a1424adcda00 (patch)
tree85154f9e2a8cb667dd0cbb97809692edb85af9f6 /Library/Homebrew/test/dev-cmd
parentb488a89b5d2bd9c96e3128f598221fed1c3c1911 (diff)
parent4e1516ce2c278a654bb192933eadaab1625affb7 (diff)
downloadbrew-3ca9a3c502ea6e5680bd635167c4a1424adcda00.tar.bz2
Merge pull request #2165 from reitermarkus/spec-bottle
Convert `brew bottle` test to spec.
Diffstat (limited to 'Library/Homebrew/test/dev-cmd')
-rw-r--r--Library/Homebrew/test/dev-cmd/bottle_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb
new file mode 100644
index 000000000..468ef2e90
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb
@@ -0,0 +1,30 @@
+describe "brew bottle", :integration_test do
+ it "builds a bottle for the given Formula" do
+ begin
+ shutup do
+ expect { brew "install", "--build-bottle", testball }
+ .to be_a_success
+ end
+
+ expect { brew "bottle", "--no-rebuild", testball }
+ .to output(/Formula not from core or any taps/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+
+ setup_test_formula "testball"
+
+ # `brew bottle` should not fail with dead symlink
+ # https://github.com/Homebrew/legacy-homebrew/issues/49007
+ (HOMEBREW_CELLAR/"testball/0.1").cd do
+ FileUtils.ln_s "not-exist", "symlink"
+ end
+
+ expect { brew "bottle", "--no-rebuild", "testball" }
+ .to output(/testball-0\.1.*\.bottle\.tar\.gz/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ ensure
+ FileUtils.rm_f Dir.glob("testball-0.1*.bottle.tar.gz")
+ end
+ end
+end