Add additional runtime_dependency related tests.
This commit is contained in:
parent
1cbc78c5dd
commit
9e2baa3bff
@ -23,6 +23,10 @@ describe Dependency do
|
||||
dep = described_class.new("foo", [:build, "bar"])
|
||||
expect(dep.tags).to eq([:build, "bar"])
|
||||
end
|
||||
|
||||
it "rejects nil names" do
|
||||
expect { described_class.new(nil) }.to raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
describe "::merge_repeats" do
|
||||
|
||||
@ -771,6 +771,20 @@ describe Formula do
|
||||
|
||||
expect(formula.runtime_dependencies.map(&:name)).to eq [dependency.name]
|
||||
end
|
||||
|
||||
it "handles bad tab runtime_dependencies" do
|
||||
formula = Class.new(Testball).new
|
||||
|
||||
formula.brew { formula.install }
|
||||
tab = Tab.create(formula, DevelopmentTools.default_compiler, :libcxx)
|
||||
tab.runtime_dependencies = ["foo"]
|
||||
tab.write
|
||||
|
||||
keg = Keg.for(formula.installed_prefix)
|
||||
keg.link
|
||||
|
||||
expect(formula.runtime_dependencies.map(&:name)).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
specify "requirements" do
|
||||
|
||||
@ -72,6 +72,12 @@ describe Formulary do
|
||||
}.to raise_error(FormulaUnavailableError)
|
||||
end
|
||||
|
||||
it "raises an error if ref is nil" do
|
||||
expect {
|
||||
described_class.factory(nil)
|
||||
}.to raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
context "when the Formula has the wrong class" do
|
||||
let(:formula_name) { "giraffe" }
|
||||
let(:formula_content) do
|
||||
|
||||
@ -138,6 +138,18 @@ describe Tab do
|
||||
expect(tab.runtime_dependencies).not_to be nil
|
||||
end
|
||||
|
||||
specify "::runtime_deps_hash" do
|
||||
runtime_deps = [Dependency.new("foo")]
|
||||
stub_formula_loader formula("foo") { url "foo-1.0" }
|
||||
runtime_deps_hash = described_class.runtime_deps_hash(runtime_deps)
|
||||
tab = described_class.new
|
||||
tab.homebrew_version = "1.1.6"
|
||||
tab.runtime_dependencies = runtime_deps_hash
|
||||
expect(tab.runtime_dependencies).to eql(
|
||||
[{ "full_name" => "foo", "version" => "1.0" }],
|
||||
)
|
||||
end
|
||||
|
||||
specify "#cxxstdlib" do
|
||||
expect(subject.cxxstdlib.compiler).to eq(:clang)
|
||||
expect(subject.cxxstdlib.type).to eq(:libcxx)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user