Skip to content
Snippets Groups Projects
Commit 3ca9a3c5 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #2165 from reitermarkus/spec-bottle

Convert `brew bottle` test to spec.
parents b488a89b 4e1516ce
No related branches found
No related tags found
No related merge requests found
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment