brew/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb
Alec Clarke 45806f6a97 Include test casks in the cask style check.
Currently the tests casks found in "/Homebrew/test/support/fixtures/cask/Casks" and "/Homebrew/test/support/fixtures/third-party/Casks" aren't included in the paths checked when running "brew cask style".

This change includes these test cask paths in the checked paths, and also includes the auto style fixes made by running `brew cask style --fix`.
2019-09-23 08:50:24 -04:00

45 lines
1.3 KiB
Ruby

# frozen_string_literal: true
describe Cask::Cmd::InternalStanza, :cask do
it "shows stanza of the Specified Cask" do
command = described_class.new("homepage", "local-caffeine")
expect {
command.run
}.to output("https://brew.sh/\n").to_stdout
end
it "raises an exception when stanza is unknown/unsupported" do
expect {
described_class.new("this_stanza_does_not_exist", "local-caffeine")
}.to raise_error(%r{Unknown/unsupported stanza})
end
it "raises an exception when normal stanza is not present on cask" do
command = described_class.new("caveats", "local-caffeine")
expect {
command.run
}.to raise_error(/no such stanza/)
end
it "raises an exception when artifact stanza is not present on cask" do
command = described_class.new("zap", "local-caffeine")
expect {
command.run
}.to raise_error(/no such stanza/)
end
it "raises an exception when 'depends_on' stanza is not present on cask" do
command = described_class.new("depends_on", "local-caffeine")
expect {
command.run
}.to raise_error(/no such stanza/)
end
it "shows all artifact stanzas when using 'artifacts' keyword" do
command = described_class.new("artifacts", "local-caffeine")
expect {
command.run
}.to output(/Caffeine\.app/).to_stdout
end
end