aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask/cli/outdated_spec.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-05-21 02:32:46 +0200
committerMarkus Reiter2017-05-22 02:51:17 +0200
commit02a1e2781fcb808b731fd04d18369ec5bfd3bc68 (patch)
tree8328ec31ac14351eeb8a231f4b932bc9f8221468 /Library/Homebrew/test/cask/cli/outdated_spec.rb
parentdf1864ee435c1c48f87344800d2e7cf055a12f93 (diff)
downloadbrew-02a1e2781fcb808b731fd04d18369ec5bfd3bc68.tar.bz2
Fix tests for `CLI::Options` DSL.
Diffstat (limited to 'Library/Homebrew/test/cask/cli/outdated_spec.rb')
-rw-r--r--Library/Homebrew/test/cask/cli/outdated_spec.rb32
1 files changed, 19 insertions, 13 deletions
diff --git a/Library/Homebrew/test/cask/cli/outdated_spec.rb b/Library/Homebrew/test/cask/cli/outdated_spec.rb
index a0f13009d..3d9e9bdeb 100644
--- a/Library/Homebrew/test/cask/cli/outdated_spec.rb
+++ b/Library/Homebrew/test/cask/cli/outdated_spec.rb
@@ -13,13 +13,13 @@ describe Hbc::CLI::Outdated, :cask do
shutup do
installed.each { |cask| InstallHelper.install_with_caskfile(cask) }
end
- allow(Hbc::CLI).to receive(:verbose?).and_return(true)
+ allow_any_instance_of(described_class).to receive(:verbose?).and_return(true)
end
describe 'without --greedy it ignores the Casks with "vesion latest" or "auto_updates true"' do
it "checks all the installed Casks when no token is provided" do
expect {
- Hbc::CLI::Outdated.run
+ described_class.run
}.to output(<<-EOS.undent).to_stdout
local-caffeine (1.2.2) != 1.2.3
local-transmission (2.60) != 2.61
@@ -28,7 +28,7 @@ describe Hbc::CLI::Outdated, :cask do
it "checks only the tokens specified in the command line" do
expect {
- Hbc::CLI::Outdated.run("local-caffeine")
+ described_class.run("local-caffeine")
}.to output(<<-EOS.undent).to_stdout
local-caffeine (1.2.2) != 1.2.3
EOS
@@ -36,26 +36,32 @@ describe Hbc::CLI::Outdated, :cask do
it 'ignores "auto_updates" and "latest" Casks even when their tokens are provided in the command line' do
expect {
- Hbc::CLI::Outdated.run("local-caffeine", "auto-updates", "version-latest-string")
+ described_class.run("local-caffeine", "auto-updates", "version-latest-string")
}.to output(<<-EOS.undent).to_stdout
local-caffeine (1.2.2) != 1.2.3
EOS
end
end
- it "lists only the names (no versions) of the outdated Casks with --quiet" do
- expect {
- Hbc::CLI::Outdated.run("--quiet")
- }.to output(<<-EOS.undent).to_stdout
- local-caffeine
- local-transmission
- EOS
+ describe "--quiet overrides --verbose" do
+ before do
+ allow_any_instance_of(described_class).to receive(:verbose?).and_call_original
+ end
+
+ it "lists only the names (no versions) of the outdated Casks with --quiet" do
+ expect {
+ described_class.run("--verbose", "--quiet")
+ }.to output(<<-EOS.undent).to_stdout
+ local-caffeine
+ local-transmission
+ EOS
+ end
end
describe "with --greedy it checks additional Casks" do
it 'includes the Casks with "auto_updates true" or "version latest" with --greedy' do
expect {
- Hbc::CLI::Outdated.run("--greedy")
+ described_class.run("--greedy")
}.to output(<<-EOS.undent).to_stdout
auto-updates (2.57) != 2.61
local-caffeine (1.2.2) != 1.2.3
@@ -69,7 +75,7 @@ describe Hbc::CLI::Outdated, :cask do
InstallHelper.install_with_caskfile(cask)
expect {
- Hbc::CLI::Outdated.run("--greedy")
+ described_class.run("--greedy")
}.to output(<<-EOS.undent).to_stdout
local-caffeine (1.2.2) != 1.2.3
local-transmission (2.60) != 2.61