Add pinned version to outdated output

This commit is contained in:
William Roe 2017-03-27 11:30:36 +01:00
parent 755d43d46d
commit 70446d9112
2 changed files with 19 additions and 1 deletions

View File

@ -64,7 +64,9 @@ module Homebrew
"#{full_name} (#{kegs.map(&:version).join(", ")})"
end.join(", ")
puts "#{outdated_versions} < #{current_version}"
pinned_version = " [pinned at #{f.pinned_version}]" if f.pinned?
puts "#{outdated_versions} < #{current_version}#{pinned_version}"
else
puts f.full_installed_specified_name
end

View File

@ -22,4 +22,20 @@ describe "brew outdated", :integration_test do
.and be_a_success
end
end
context "pinned formula, verbose output" do
it "prints out the pinned version" do
setup_test_formula "testball"
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
shutup do
expect { brew "pin", "testball" }.to be_a_success
end
expect { brew "outdated", "--verbose" }
.to output("testball (0.0.1) < 0.1 [pinned at 0.0.1]\n").to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
end
end