diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 97367ca1e2..4d7dba0dbc 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -42,6 +42,7 @@ module Homebrew fetch_head = ARGV.fetch_head? outdated_formulae = formulae.select { |f| f.outdated?(fetch_head: fetch_head) } + .sort outdated_formulae.each do |f| if verbose diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index 8b4c01e538..f24a3c5710 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -4,8 +4,11 @@ describe "brew outdated", :integration_test do setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath + setup_test_formula "foo" + (HOMEBREW_CELLAR/"foo/0.0.1/foo").mkpath + expect { brew "outdated" } - .to output("testball\n").to_stdout + .to output("foo\ntestball\n").to_stdout .and not_to_output.to_stderr .and be_a_success end