summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2020-01-05 06:56:11 +0900
committerSutou Kouhei <kou@clear-code.com>2020-01-15 06:27:03 +0900
commit13f5a8a72090727e55ec789f44a1820ad61069d3 (patch)
treec443708c55dc49c7ecac0732c73bc45157a3e02f
parent9397c2c75486bc0178ab8486fc2bc44c95d924b8 (diff)
downloadbundler-13f5a8a72090727e55ec789f44a1820ad61069d3.tar.gz
Update expected for specific_platform feature flags case
In this case, Bundler uses specific platform to resolve dependency. So error message includes specific platform information.
-rw-r--r--spec/install/gems/flex_spec.rb10
-rw-r--r--spec/install/gems/resolving_spec.rb11
2 files changed, 17 insertions, 4 deletions
diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb
index 77891acc24..70a4c624dd 100644
--- a/spec/install/gems/flex_spec.rb
+++ b/spec/install/gems/flex_spec.rb
@@ -192,6 +192,12 @@ RSpec.describe "bundle flex_install" do
end
it "suggests bundle update when the Gemfile requires different versions than the lock" do
+ if Bundler.feature_flag.specific_platform?
+ error_message_platform = " #{Bundler.local_platform}"
+ else
+ error_message_platform = ""
+ end
+
bundle "config set force_ruby_platform true"
nice_error = <<-E.strip.gsub(/^ {8}/, "")
@@ -201,10 +207,10 @@ RSpec.describe "bundle flex_install" do
In Gemfile:
rack-obama (= 2.0) was resolved to 2.0, which depends on
- rack (= 1.2)
+ rack (= 1.2)#{error_message_platform}
rack_middleware was resolved to 1.0, which depends on
- rack (= 0.9.1)
+ rack (= 0.9.1)#{error_message_platform}
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 523f9eb151..0e933bfd8e 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -156,6 +156,13 @@ RSpec.describe "bundle install with install-time dependencies" do
let(:ruby_requirement) { %("#{RUBY_VERSION}") }
let(:error_message_requirement) { "~> #{RUBY_VERSION}.0" }
+ let(:error_message_platform) do
+ if Bundler.feature_flag.specific_platform?
+ " #{Bundler.local_platform}"
+ else
+ ""
+ end
+ end
shared_examples_for "ruby version conflicts" do
it "raises an error during resolution" do
@@ -172,10 +179,10 @@ RSpec.describe "bundle install with install-time dependencies" do
nice_error = strip_whitespace(<<-E).strip
Bundler found conflicting requirements for the Ruby\0 version:
In Gemfile:
- Ruby\0 (#{error_message_requirement})
+ Ruby\0 (#{error_message_requirement})#{error_message_platform}
require_ruby was resolved to 1.0, which depends on
- Ruby\0 (> 9000)
+ Ruby\0 (> 9000)#{error_message_platform}
Ruby\0 (> 9000), which is required by gem 'require_ruby', is not available in the local ruby installation
E