diff options
| author | Markus Reiter | 2017-02-23 05:58:30 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-23 21:40:49 +0100 |
| commit | 4e1516ce2c278a654bb192933eadaab1625affb7 (patch) | |
| tree | ee8294d29507d5bef627485466e27d67f0b2ff5c /Library/Homebrew | |
| parent | c7121f6be50e44784e3e29114617c29715bd9c0f (diff) | |
| download | brew-4e1516ce2c278a654bb192933eadaab1625affb7.tar.bz2 | |
Convert `brew bottle` test to spec.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/test/bottle_test.rb | 21 | ||||
| -rw-r--r-- | Library/Homebrew/test/dev-cmd/bottle_spec.rb | 30 |
2 files changed, 30 insertions, 21 deletions
diff --git a/Library/Homebrew/test/bottle_test.rb b/Library/Homebrew/test/bottle_test.rb deleted file mode 100644 index 7981ccf79..000000000 --- a/Library/Homebrew/test/bottle_test.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestBottle < IntegrationCommandTestCase - def test_bottle - cmd("install", "--build-bottle", testball) - assert_match "Formula not from core or any taps", - cmd_fail("bottle", "--no-rebuild", testball) - - 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 - assert_match(/testball-0\.1.*\.bottle\.tar\.gz/, - cmd("bottle", "--no-rebuild", "testball")) - ensure - FileUtils.rm_f Dir["testball-0.1*.bottle.tar.gz"] - end -end 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 |
