summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/install/gemfile')
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb53
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb11
2 files changed, 60 insertions, 4 deletions
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index ec6a1d4a4a..32dd7d24b8 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -567,4 +567,57 @@ RSpec.describe "bundle install from an existing gemspec" do
expect(the_bundle).not_to include_gem "rack"
end
end
+
+ context "with multiple platforms and resolving for more specific platforms" do
+ before do
+ build_lib("chef", :path => tmp.join("chef")) do |s|
+ s.version = "17.1.17"
+ s.write "chef-universal-mingw32.gemspec", build_spec("chef", "17.1.17", "universal-mingw32") {|sw| sw.runtime "win32-api", "~> 1.5.3" }.first.to_ruby
+ end
+ end
+
+ it "does not remove the platform specific specs from the lockfile when updating" do
+ build_repo4 do
+ build_gem "win32-api", "1.5.3" do |s|
+ s.platform = "universal-mingw32"
+ end
+ end
+
+ gemfile <<-G
+ source "#{file_uri_for(gem_repo4)}"
+ gemspec :path => "../chef"
+ G
+
+ initial_lockfile = <<~L
+ PATH
+ remote: ../chef
+ specs:
+ chef (17.1.17)
+ chef (17.1.17-universal-mingw32)
+ win32-api (~> 1.5.3)
+
+ GEM
+ remote: #{file_uri_for(gem_repo4)}/
+ specs:
+ win32-api (1.5.3-universal-mingw32)
+
+ PLATFORMS
+ ruby
+ x64-mingw32
+ x86-mingw32
+
+ DEPENDENCIES
+ chef!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ lockfile initial_lockfile
+
+ bundle "update"
+
+ expect(lockfile).to eq initial_lockfile
+ end
+ end
end
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index d86bc18311..4f931a493b 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -90,7 +90,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "thin" # comes first to test name sorting
gem "rack"
end
- gem "rack-obama" # shoud come from repo3!
+ gem "rack-obama" # should come from repo3!
G
end
@@ -596,7 +596,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
L
end
- it "it keeps the currrent lockfile format and upgrades the requested gem when running bundle update with an argument, and warns", :bundler => "< 3" do
+ it "it keeps the current lockfile format and upgrades the requested gem when running bundle update with an argument, and warns", :bundler => "< 3" do
bundle "update concurrent-ruby"
expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
@@ -921,7 +921,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
- gem "rack" # shoud come from repo1!
+ gem "rack" # should come from repo1!
G
end
@@ -974,7 +974,10 @@ RSpec.describe "bundle install with gems on multiple sources" do
context "re-resolving" do
context "when there is a mix of sources in the gemfile" do
before do
- build_repo3
+ build_repo gem_repo3 do
+ build_gem "rack"
+ end
+
build_lib "path1"
build_lib "path2"
build_git "git1"