Merge pull request #13311 from bevanjkay/fix-outdated-greedy
cask: fix greedy outdated command
This commit is contained in:
commit
845925bf56
@ -173,13 +173,11 @@ module Cask
|
||||
version
|
||||
end
|
||||
|
||||
if greedy || greedy_latest || (greedy_auto_updates && auto_updates)
|
||||
if latest_version.latest?
|
||||
return versions if outdated_download_sha?
|
||||
if latest_version.latest?
|
||||
return versions if (greedy || greedy_latest) && outdated_download_sha?
|
||||
|
||||
return []
|
||||
end
|
||||
elsif auto_updates
|
||||
return []
|
||||
elsif auto_updates && !greedy && !greedy_auto_updates
|
||||
return []
|
||||
end
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ describe Cask::Cask, :cask do
|
||||
shared_examples ":latest cask" do |greedy, outdated_sha, tap_version, expectations|
|
||||
expectations.each do |installed_version, expected_output|
|
||||
context "when versions #{installed_version} are installed and the " \
|
||||
"tap version is #{tap_version}, #{"not " unless greedy}greedy" \
|
||||
"tap version is #{tap_version}, #{"not " unless greedy}greedy " \
|
||||
"and sha is #{"not " unless outdated_sha}outdated" do
|
||||
subject { cask.outdated_versions(greedy: greedy) }
|
||||
|
||||
@ -160,7 +160,7 @@ describe Cask::Cask, :cask do
|
||||
|
||||
describe "numbered version installed, :latest version in tap" do
|
||||
include_examples ":latest cask", false, false, "latest",
|
||||
["1.2.3"] => ["1.2.3"]
|
||||
["1.2.3"] => []
|
||||
include_examples ":latest cask", true, false, "latest",
|
||||
["1.2.3"] => []
|
||||
include_examples ":latest cask", true, true, "latest",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user