formulary: add test for loading service blocks from API
This commit is contained in:
parent
501730df5d
commit
d42e9b40d5
@ -272,6 +272,11 @@ describe Formulary do
|
|||||||
"conflicts_with_reasons" => ["it does"],
|
"conflicts_with_reasons" => ["it does"],
|
||||||
"link_overwrite" => ["bin/abc"],
|
"link_overwrite" => ["bin/abc"],
|
||||||
"caveats" => "example caveat string",
|
"caveats" => "example caveat string",
|
||||||
|
"service" => {
|
||||||
|
"run" => ["$HOMEBREW_PREFIX/opt/formula_name/bin/beanstalkd", "test"],
|
||||||
|
"run_type" => :immediate,
|
||||||
|
"working_dir" => "$HOME",
|
||||||
|
},
|
||||||
}.merge(extra_items),
|
}.merge(extra_items),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -354,6 +359,11 @@ describe Formulary do
|
|||||||
|
|
||||||
expect(formula.caveats).to eq "example caveat string"
|
expect(formula.caveats).to eq "example caveat string"
|
||||||
|
|
||||||
|
expect(formula).to be_a_service
|
||||||
|
expect(formula.service.command).to eq(["#{HOMEBREW_PREFIX}/opt/formula_name/bin/beanstalkd", "test"])
|
||||||
|
expect(formula.service.run_type).to eq(:immediate)
|
||||||
|
expect(formula.service.working_dir).to eq(Dir.home)
|
||||||
|
|
||||||
expect do
|
expect do
|
||||||
formula.install
|
formula.install
|
||||||
end.to raise_error("Cannot build from source from abstract formula.")
|
end.to raise_error("Cannot build from source from abstract formula.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user