brew/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb
Claudia 5be80a78f6
Use Homebrew-controlled domain for Cask dummy URLs
In a number of Cask specs, the value of the `homepage` stanza is currently set
to https://example.com. As of 2018-11-28, the TLS certificate served by
example.com seems to be expired, possibly due to an oversight on ICANN’s side.

While the certificate is certainly going to be renewed soon, it would be
desirable for Homebrew’s test result to be less dependent on ICANN’s actions.
This commit changes the homepages of all test Casks to http://brew.sh, whose
domain and TLS certificate are both controlled by Homebrew.
2018-11-28 20:51:55 +01:00

43 lines
1.3 KiB
Ruby

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