aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask/cli
diff options
context:
space:
mode:
authorMartin Schimandl2017-10-07 21:32:40 +0200
committerMartin Schimandl2017-11-10 20:16:38 +0100
commitff2239509d53f86ca48330ddfc6f24fe03ba9768 (patch)
treed974cd7012b87eff3ab52c30e2796846f5bec590 /Library/Homebrew/test/cask/cli
parentbe68f3d7b49f2e9b84e7230d5c22b6522992ea8c (diff)
downloadbrew-ff2239509d53f86ca48330ddfc6f24fe03ba9768.tar.bz2
Change behaviour of 'cask _stanza' command. Add tests for 'cask _stanza' command
Diffstat (limited to 'Library/Homebrew/test/cask/cli')
-rw-r--r--Library/Homebrew/test/cask/cli/internal_stanza_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb b/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb
new file mode 100644
index 000000000..77b065567
--- /dev/null
+++ b/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb
@@ -0,0 +1,28 @@
+describe Hbc::CLI::InternalStanza, :cask do
+
+ it "shows stanza of the Specified Cask" do
+ command = described_class.new("gpg", "with-gpg");
+ command.run
+ # TODO check result
+ end
+
+ it "raises an exception when stanza is invalid" do
+ expect {
+ described_class.new("invalid_stanza", "with-gpg");
+ }.to raise_error(/Illegal 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
+end