From d7487d6c0845f89b0d640d1e22a4a10d1ffdb1a3 Mon Sep 17 00:00:00 2001 From: David Rodríguez Date: Tue, 23 Jul 2019 13:11:33 +0200 Subject: [bundler/bundler] Try make some specs platform independent https://github.com/bundler/bundler/commit/b5900e57a4 --- spec/bundler/commands/add_spec.rb | 1 + spec/bundler/commands/install_spec.rb | 2 ++ spec/bundler/commands/post_bundle_message_spec.rb | 4 ++++ spec/bundler/install/bundler_spec.rb | 6 ++++++ spec/bundler/install/gems/flex_spec.rb | 2 ++ spec/bundler/install/yanked_spec.rb | 2 ++ 6 files changed, 17 insertions(+) diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb index 947dfbcfaa..fdfca5d8f2 100644 --- a/spec/bundler/commands/add_spec.rb +++ b/spec/bundler/commands/add_spec.rb @@ -134,6 +134,7 @@ RSpec.describe "bundle add" do end it "shows error message when gem cannot be found" do + bundle "config set force_ruby_platform true" bundle "add 'werk_it'" expect(err).to match("Could not find gem 'werk_it' in") diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 5dfce3a2c3..e279d71827 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -524,6 +524,8 @@ RSpec.describe "bundle install with gem sources" do describe "when requesting a quiet install via --quiet" do it "should be quiet" do + bundle "config set force_ruby_platform true" + gemfile <<-G gem 'rack' G diff --git a/spec/bundler/commands/post_bundle_message_spec.rb b/spec/bundler/commands/post_bundle_message_spec.rb index 228893f552..6fd4fb7089 100644 --- a/spec/bundler/commands/post_bundle_message_spec.rb +++ b/spec/bundler/commands/post_bundle_message_spec.rb @@ -101,6 +101,10 @@ RSpec.describe "post bundle message" do end describe "with misspelled or non-existent gem name" do + before do + bundle "config set force_ruby_platform true" + end + it "should report a helpful error message", :bundler => "< 3" do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" diff --git a/spec/bundler/install/bundler_spec.rb b/spec/bundler/install/bundler_spec.rb index 85b1fdcfbb..818c6b1ad9 100644 --- a/spec/bundler/install/bundler_spec.rb +++ b/spec/bundler/install/bundler_spec.rb @@ -30,6 +30,8 @@ RSpec.describe "bundle install" do end it "causes a conflict if explicitly requesting a different version" do + bundle "config set force_ruby_platform true" + install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" gem "rails", "3.0" @@ -89,6 +91,8 @@ RSpec.describe "bundle install" do end it "causes a conflict if child dependencies conflict" do + bundle "config set force_ruby_platform true" + install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" gem "activemerchant" @@ -108,6 +112,8 @@ RSpec.describe "bundle install" do end it "causes a conflict if a child dependency conflicts with the Gemfile" do + bundle "config set force_ruby_platform true" + install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" gem "rails_fail" diff --git a/spec/bundler/install/gems/flex_spec.rb b/spec/bundler/install/gems/flex_spec.rb index 65116addb5..865bc7b72a 100644 --- a/spec/bundler/install/gems/flex_spec.rb +++ b/spec/bundler/install/gems/flex_spec.rb @@ -192,6 +192,8 @@ RSpec.describe "bundle flex_install" do end it "suggests bundle update when the Gemfile requires different versions than the lock" do + bundle "config set force_ruby_platform true" + nice_error = <<-E.strip.gsub(/^ {8}/, "") Bundler could not find compatible versions for gem "rack": In snapshot (Gemfile.lock): diff --git a/spec/bundler/install/yanked_spec.rb b/spec/bundler/install/yanked_spec.rb index b8e54dc807..80729b3f5b 100644 --- a/spec/bundler/install/yanked_spec.rb +++ b/spec/bundler/install/yanked_spec.rb @@ -31,6 +31,8 @@ RSpec.context "when installing a bundle that includes yanked gems" do end it "throws the original error when only the Gemfile specifies a gem version that doesn't exist" do + bundle "config set force_ruby_platform true" + install_gemfile <<-G source "#{file_uri_for(gem_repo4)}" gem "foo", "10.0.0" -- cgit v1.2.3