diff options
| author | Martin Schimandl | 2017-10-08 17:41:03 +0200 | 
|---|---|---|
| committer | Martin Schimandl | 2017-11-10 20:16:38 +0100 | 
| commit | db2c86204b84e70ef6cef912ac410ea93551127f (patch) | |
| tree | 5fca0ad2c8b861d4437f2c144d0255f7f4d0cc70 /Library/Homebrew/test/cask/cli | |
| parent | 7f70080c94b6ef9b772b3464a0c0bb9420a407e0 (diff) | |
| download | brew-db2c86204b84e70ef6cef912ac410ea93551127f.tar.bz2 | |
internal_stanza.rb: Remove obsolete code. Improve detection of missing stanzas
internal_stanza_spec.rb: change do ... end blocks to { } blocks
Diffstat (limited to 'Library/Homebrew/test/cask/cli')
| -rw-r--r-- | Library/Homebrew/test/cask/cli/internal_stanza_spec.rb | 27 | 
1 files changed, 17 insertions, 10 deletions
diff --git a/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb b/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb index f3002e222..52bbf4ee0 100644 --- a/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb +++ b/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb @@ -1,35 +1,42 @@  describe Hbc::CLI::InternalStanza, :cask do    it "shows stanza of the Specified Cask" do      command = described_class.new("gpg", "with-gpg") -    expect do +    expect {        command.run -    end.to output("http://example.com/gpg-signature.asc\n").to_stdout +    }.to output("http://example.com/gpg-signature.asc\n").to_stdout    end    it "raises an exception when stanza is invalid" do -    expect do +    expect {        described_class.new("invalid_stanza", "with-gpg") -    end.to raise_error(/Illegal stanza/) +    }.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 do +    expect {        command.run -    end.to raise_error(/no such stanza/) +    }.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 do +    expect {        command.run -    end.to raise_error(/no such stanza/) +    }.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 do +    expect {        command.run -    end.to output("{:app=>[[\"Caffeine.app\"]]}\n").to_stdout +    }.to output("{:app=>[[\"Caffeine.app\"]]}\n").to_stdout    end  end  | 
