aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-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