move cask/cmd/info_spec to cask/info_spec
This commit is contained in:
parent
efdef5f26c
commit
198c6f6b8c
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
require "utils"
|
require "utils"
|
||||||
|
|
||||||
describe Cask::Cmd::Info, :cask do
|
describe Cask::Info, :cask do
|
||||||
it "displays some nice info about the specified Cask" do
|
it "displays some nice info about the specified Cask" do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("local-transmission")
|
described_class.info(Cask::CaskLoader.load("local-transmission"))
|
||||||
}.to output(<<~EOS).to_stdout
|
}.to output(<<~EOS).to_stdout
|
||||||
==> local-transmission: 2.61
|
==> local-transmission: 2.61
|
||||||
https://transmissionbt.com/
|
https://transmissionbt.com/
|
||||||
@ -23,7 +23,7 @@ describe Cask::Cmd::Info, :cask do
|
|||||||
|
|
||||||
it "prints auto_updates if the Cask has `auto_updates true`" do
|
it "prints auto_updates if the Cask has `auto_updates true`" do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("with-auto-updates")
|
described_class.info(Cask::CaskLoader.load("with-auto-updates"))
|
||||||
}.to output(<<~EOS).to_stdout
|
}.to output(<<~EOS).to_stdout
|
||||||
==> with-auto-updates: 1.0 (auto_updates)
|
==> with-auto-updates: 1.0 (auto_updates)
|
||||||
https://brew.sh/autoupdates
|
https://brew.sh/autoupdates
|
||||||
@ -38,43 +38,9 @@ describe Cask::Cmd::Info, :cask do
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "given multiple Casks" do
|
|
||||||
let(:expected_output) {
|
|
||||||
<<~EOS
|
|
||||||
==> local-caffeine: 1.2.3
|
|
||||||
https://brew.sh/
|
|
||||||
Not installed
|
|
||||||
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/local-caffeine.rb
|
|
||||||
==> Name
|
|
||||||
None
|
|
||||||
==> Description
|
|
||||||
None
|
|
||||||
==> Artifacts
|
|
||||||
Caffeine.app (App)
|
|
||||||
|
|
||||||
==> local-transmission: 2.61
|
|
||||||
https://transmissionbt.com/
|
|
||||||
Not installed
|
|
||||||
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/local-transmission.rb
|
|
||||||
==> Name
|
|
||||||
Transmission
|
|
||||||
==> Description
|
|
||||||
BitTorrent client
|
|
||||||
==> Artifacts
|
|
||||||
Transmission.app (App)
|
|
||||||
EOS
|
|
||||||
}
|
|
||||||
|
|
||||||
it "displays the info" do
|
|
||||||
expect {
|
|
||||||
described_class.run("local-caffeine", "local-transmission")
|
|
||||||
}.to output(expected_output).to_stdout
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
it "prints caveats if the Cask provided one" do
|
it "prints caveats if the Cask provided one" do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("with-caveats")
|
described_class.info(Cask::CaskLoader.load("with-caveats"))
|
||||||
}.to output(<<~EOS).to_stdout
|
}.to output(<<~EOS).to_stdout
|
||||||
==> with-caveats: 1.2.3
|
==> with-caveats: 1.2.3
|
||||||
https://brew.sh/
|
https://brew.sh/
|
||||||
@ -101,7 +67,7 @@ describe Cask::Cmd::Info, :cask do
|
|||||||
|
|
||||||
it 'does not print "Caveats" section divider if the caveats block has no output' do
|
it 'does not print "Caveats" section divider if the caveats block has no output' do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("with-conditional-caveats")
|
described_class.info(Cask::CaskLoader.load("with-conditional-caveats"))
|
||||||
}.to output(<<~EOS).to_stdout
|
}.to output(<<~EOS).to_stdout
|
||||||
==> with-conditional-caveats: 1.2.3
|
==> with-conditional-caveats: 1.2.3
|
||||||
https://brew.sh/
|
https://brew.sh/
|
||||||
@ -118,7 +84,7 @@ describe Cask::Cmd::Info, :cask do
|
|||||||
|
|
||||||
it "prints languages specified in the Cask" do
|
it "prints languages specified in the Cask" do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("with-languages")
|
described_class.info(Cask::CaskLoader.load("with-languages"))
|
||||||
}.to output(<<~EOS).to_stdout
|
}.to output(<<~EOS).to_stdout
|
||||||
==> with-languages: 1.2.3
|
==> with-languages: 1.2.3
|
||||||
https://brew.sh/
|
https://brew.sh/
|
||||||
@ -137,7 +103,7 @@ describe Cask::Cmd::Info, :cask do
|
|||||||
|
|
||||||
it 'does not print "Languages" section divider if the languages block has no output' do
|
it 'does not print "Languages" section divider if the languages block has no output' do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("without-languages")
|
described_class.info(Cask::CaskLoader.load("without-languages"))
|
||||||
}.to output(<<~EOS).to_stdout
|
}.to output(<<~EOS).to_stdout
|
||||||
==> without-languages: 1.2.3
|
==> without-languages: 1.2.3
|
||||||
https://brew.sh/
|
https://brew.sh/
|
||||||
Loading…
x
Reference in New Issue
Block a user