diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-08-29 09:14:18 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-08-29 11:17:18 -0500 |
commit | 9d169fba74922b6e19713dd3f362dafd7df7f606 (patch) | |
tree | dd719bbbd8e9f3f304a221e29ac35e1b2d4ad20b | |
parent | 1fef53681d97914190b6120a6ccf02858148353a (diff) | |
download | bundler-9d169fba74922b6e19713dd3f362dafd7df7f606.tar.gz |
Fix outdated bundler suggestion logic
-rw-r--r-- | lib/bundler/cli.rb | 4 | ||||
-rw-r--r-- | spec/bundler/cli_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index af6edf90be..d1bdc09f2f 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -723,8 +723,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) |