summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 13:11:33 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 16:57:30 +0200
commitb5900e57a4f337319962f25bde368c49865ea662 (patch)
tree19fe26407a372dc885aade559587f176c13d4513
parent344a8815920120c1149a9a59fe57457f3a974b41 (diff)
downloadbundler-b5900e57a4f337319962f25bde368c49865ea662.tar.gz
Try make some specs platform independent
-rw-r--r--spec/commands/add_spec.rb1
-rw-r--r--spec/commands/install_spec.rb2
-rw-r--r--spec/commands/post_bundle_message_spec.rb4
-rw-r--r--spec/install/bundler_spec.rb6
-rw-r--r--spec/install/gems/flex_spec.rb2
-rw-r--r--spec/install/yanked_spec.rb2
6 files changed, 17 insertions, 0 deletions
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb
index 947dfbcfaa..fdfca5d8f2 100644
--- a/spec/commands/add_spec.rb
+++ b/spec/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/commands/install_spec.rb b/spec/commands/install_spec.rb
index 5dfce3a2c3..e279d71827 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/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/commands/post_bundle_message_spec.rb b/spec/commands/post_bundle_message_spec.rb
index 228893f552..6fd4fb7089 100644
--- a/spec/commands/post_bundle_message_spec.rb
+++ b/spec/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/install/bundler_spec.rb b/spec/install/bundler_spec.rb
index 8741a5e771..6ea15d13b5 100644
--- a/spec/install/bundler_spec.rb
+++ b/spec/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/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb
index 65116addb5..865bc7b72a 100644
--- a/spec/install/gems/flex_spec.rb
+++ b/spec/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/install/yanked_spec.rb b/spec/install/yanked_spec.rb
index b8e54dc807..80729b3f5b 100644
--- a/spec/install/yanked_spec.rb
+++ b/spec/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"