-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3258 from Git-Jiro/improve_internal_stanza_command
improve 'brew cask _stanza' by checking for known stanzas
- Loading branch information
Showing
2 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
describe Hbc::CLI::InternalStanza, :cask do | ||
it "shows stanza of the Specified Cask" do | ||
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") | ||
}.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", "with-gpg") | ||
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", "with-gpg") | ||
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", "with-gpg") | ||
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", "with-gpg") | ||
expect { | ||
command.run | ||
}.to output(/Caffeine\.app/).to_stdout | ||
end | ||
end |