summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-08-29 09:14:18 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-08-29 18:13:45 -0500
commit6e52390732c4ef933263e3b446ecd3bae1801896 (patch)
treeab039c5cb31184ac19dd4b30bb0d958c21b25cac
parent765002f2d8c29be19371ff9d8ce49121a29cf8bb (diff)
downloadbundler-6e52390732c4ef933263e3b446ecd3bae1801896.tar.gz
Fix outdated bundler suggestion logic
-rw-r--r--lib/bundler/cli.rb4
-rw-r--r--spec/bundler/cli_spec.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 00f70be48c..3878da54a9 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -730,8 +730,8 @@ module Bundler
installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
if latest_installed && latest_installed > current
- suggestion = "To update to the most recent installed version, run `bundle update --bundler`"
- suggestion = "#{installation}\n#{suggestion}" if latest_installed > latest
+ suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
+ suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
else
suggestion = installation
end
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index fd4820b67f..4302bf0ed7 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -107,7 +107,7 @@ RSpec.describe "bundle executable" do
end
context "when the latest version is greater than the current version" do
- let(:latest_version) { "2.0" }
+ let(:latest_version) { "222.0" }
it "prints the version warning" do
bundle "fail"
expect(last_command.stdout).to start_with(<<-EOS.strip)
@@ -132,7 +132,7 @@ To install the latest version, run `gem install bundler`
end
context "and is a pre-release" do
- let(:latest_version) { "2.0.0.pre.4" }
+ let(:latest_version) { "222.0.0.pre.4" }
it "prints the version warning" do
bundle "fail"
expect(last_command.stdout).to start_with(<<-EOS.strip)