summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-18 16:38:51 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-18 16:38:51 +0100
commit0c71faa0effe4d58c73e166b5fd0d632ba67b480 (patch)
treeea635be982e94e705074f623fd4c90ef773057eb
parent5565aa416e46192dcec4a0717833df05eb44d6dc (diff)
downloadbundler-fix_upgrade_instructions.tar.gz
Fix warning message about bundler versionfix_upgrade_instructions
To actually make the warning go away, we need to recommend exactly installing the locked version. Otherwise the latest version gets installed, but not used to being a different major than the one locked, so the warning stays.
-rw-r--r--lib/bundler/lockfile_parser.rb6
-rw-r--r--spec/lock/lockfile_bundler_1_spec.rb4
-rw-r--r--spec/lock/lockfile_spec.rb4
3 files changed, 9 insertions, 5 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index a7d4dc56b7..cd42919da2 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -107,9 +107,9 @@ module Bundler
when 0
if current_version < bundler_version
Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
- "than the version that created the lockfile (#{bundler_version}). We suggest you " \
- "upgrade to the latest version of Bundler by running `gem " \
- "install bundler#{prerelease_text}`.\n"
+ "than the version that created the lockfile (#{bundler_version}). We suggest you to " \
+ "upgrade to the version that created the lockfile by running `gem install " \
+ "bundler:#{bundler_version}#{prerelease_text}`.\n"
end
end
end
diff --git a/spec/lock/lockfile_bundler_1_spec.rb b/spec/lock/lockfile_bundler_1_spec.rb
index 0e89645503..625068de38 100644
--- a/spec/lock/lockfile_bundler_1_spec.rb
+++ b/spec/lock/lockfile_bundler_1_spec.rb
@@ -180,7 +180,9 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do
end
warning_message = "the running version of Bundler (9999999.0.0) is older " \
- "than the version that created the lockfile (9999999.1.0)"
+ "than the version that created the lockfile (9999999.1.0). " \
+ "We suggest you to upgrade to the version that created the " \
+ "lockfile by running `gem install bundler:9999999.1.0`."
expect(last_command.stderr.scan(warning_message).size).to eq(1)
lockfile_should_be <<-G
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index a77ce83f9f..3ec079ac65 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -180,7 +180,9 @@ RSpec.describe "the lockfile format", :bundler => "2" do
end
warning_message = "the running version of Bundler (9999999.0.0) is older " \
- "than the version that created the lockfile (9999999.1.0)"
+ "than the version that created the lockfile (9999999.1.0). " \
+ "We suggest you to upgrade to the version that created the " \
+ "lockfile by running `gem install bundler:9999999.1.0`."
expect(last_command.bundler_err).to include warning_message
lockfile_should_be <<-G