Alphabetize the brew outdated formula listing.

Sorts by `Formula#<=>`.

Includes updated test example.
This commit is contained in:
Douglas F Shearer 2018-05-16 13:01:12 +01:00
parent af578f53a4
commit 18b362aa96
2 changed files with 7 additions and 2 deletions

View File

@ -41,7 +41,9 @@ module Homebrew
verbose = ($stdout.tty? || ARGV.verbose?) && !ARGV.flag?("--quiet") verbose = ($stdout.tty? || ARGV.verbose?) && !ARGV.flag?("--quiet")
fetch_head = ARGV.fetch_head? fetch_head = ARGV.fetch_head?
outdated_formulae = formulae.select { |f| f.outdated?(fetch_head: fetch_head) } outdated_formulae = formulae
.select { |f| f.outdated?(fetch_head: fetch_head) }
.sort
outdated_formulae.each do |f| outdated_formulae.each do |f|
if verbose if verbose

View File

@ -4,8 +4,11 @@ describe "brew outdated", :integration_test do
setup_test_formula "testball" setup_test_formula "testball"
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
setup_test_formula "foo"
(HOMEBREW_CELLAR/"foo/0.0.1/foo").mkpath
expect { brew "outdated" } expect { brew "outdated" }
.to output("testball\n").to_stdout .to output("foo\ntestball\n").to_stdout
.and not_to_output.to_stderr .and not_to_output.to_stderr
.and be_a_success .and be_a_success
end end