formulary: add test for loading service blocks from API

This commit is contained in:
apainintheneck 2023-03-18 15:18:29 -07:00
parent 501730df5d
commit d42e9b40d5

View File

@ -272,6 +272,11 @@ describe Formulary do
"conflicts_with_reasons" => ["it does"],
"link_overwrite" => ["bin/abc"],
"caveats" => "example caveat string",
"service" => {
"run" => ["$HOMEBREW_PREFIX/opt/formula_name/bin/beanstalkd", "test"],
"run_type" => :immediate,
"working_dir" => "$HOME",
},
}.merge(extra_items),
}
end
@ -354,6 +359,11 @@ describe Formulary do
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
formula.install
end.to raise_error("Cannot build from source from abstract formula.")