brew/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb

43 lines
1.3 KiB
Ruby
Raw Normal View History

describe Hbc::CLI::InternalStanza, :cask do
it "shows stanza of the Specified Cask" do
2017-10-07 23:07:31 +02:00
command = described_class.new("gpg", "with-gpg")
expect {
command.run
}.to output("http://example.com/gpg-signature.asc\n").to_stdout
end
it "raises an exception when stanza is unknown/unsupported" do
expect {
described_class.new("this_stanza_does_not_exist", "with-gpg")
2017-10-23 06:49:12 +02:00
}.to raise_error(%r{Unknown/unsupported stanza})
end
it "raises an exception when normal stanza is not present on cask" do
2017-10-07 23:07:31 +02:00
command = described_class.new("caveats", "with-gpg")
expect {
2017-10-07 23:07:31 +02:00
command.run
}.to raise_error(/no such stanza/)
end
it "raises an exception when artifact stanza is not present on cask" do
2017-10-07 23:07:31 +02:00
command = described_class.new("zap", "with-gpg")
expect {
2017-10-07 23:07:31 +02:00
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", "with-gpg")
expect {
command.run
}.to raise_error(/no such stanza/)
end
2017-10-08 12:34:15 +02:00
it "shows all artifact stanzas when using 'artifacts' keyword" do
command = described_class.new("artifacts", "with-gpg")
expect {
2017-10-08 12:34:15 +02:00
command.run
}.to output(/Caffeine\.app/).to_stdout
2017-10-08 12:34:15 +02:00
end
end