summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-10-15 13:20:25 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-10-15 17:19:02 +0900
commitd386a58f6f1865aaa35eda5af55cff3ff3cca4ca (patch)
tree0665fe806540deae7f8e52095af6dba70f940aa3 /spec/bundler/install/gemfile
parent7ffd14a18c341565afaf80d259f9fe5df8a13d29 (diff)
Merge bundler-2.2.0.rc.2
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3659
Diffstat (limited to 'spec/bundler/install/gemfile')
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb18
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb56
2 files changed, 73 insertions, 1 deletions
diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb
index c0e2510acd..a70fb18c45 100644
--- a/spec/bundler/install/gemfile/git_spec.rb
+++ b/spec/bundler/install/gemfile/git_spec.rb
@@ -864,6 +864,24 @@ RSpec.describe "bundle install with git sources" do
expect(the_bundle).to include_gems "has_submodule 1.0"
end
+ it "does not warn when deiniting submodules" do
+ build_git "submodule", "1.0"
+ build_git "has_submodule", "1.0"
+
+ sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", :dir => lib_path("has_submodule-1.0")
+ sys_exec "git commit -m \"submodulator\"", :dir => lib_path("has_submodule-1.0")
+
+ install_gemfile <<-G
+ git "#{lib_path("has_submodule-1.0")}" do
+ gem "has_submodule"
+ end
+ G
+ expect(err).to be_empty
+
+ expect(the_bundle).to include_gems "has_submodule 1.0"
+ expect(the_bundle).to_not include_gems "submodule 1.0"
+ end
+
it "handles implicit updates when modifying the source info" do
git = build_git "foo"
diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb
index dd58aef29b..41b95481cb 100644
--- a/spec/bundler/install/gemfile/platform_spec.rb
+++ b/spec/bundler/install/gemfile/platform_spec.rb
@@ -50,6 +50,31 @@ RSpec.describe "bundle install across platforms" do
expect(the_bundle).to include_gems "platform_specific 1.0 JAVA"
end
+ it "pulls the pure ruby version on jruby if the java platform is not present in the lockfile and bundler is run in frozen mode", :jruby do
+ lockfile <<-G
+ GEM
+ remote: #{file_uri_for(gem_repo1)}
+ specs:
+ platform_specific (1.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ platform_specific
+ G
+
+ bundle "config set --local frozen true"
+
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo1)}"
+
+ gem "platform_specific"
+ G
+
+ expect(the_bundle).to include_gems "platform_specific 1.0 RUBY"
+ end
+
it "works with gems that have different dependencies" do
simulate_platform "java"
install_gemfile <<-G
@@ -250,12 +275,41 @@ RSpec.describe "bundle install across platforms" do
expect(err).to include "Unable to use the platform-specific (universal-darwin) version of facter (2.4.6) " \
"because it has different dependencies from the ruby version. " \
- "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
+ "To use the platform-specific version of the gem, run `bundle config set --local specific_platform true` and install again."
expect(the_bundle).to include_gem "facter 2.4.6"
expect(the_bundle).not_to include_gem "CFPropertyList"
end
+ it "works with gems with platform-specific dependency having different requirements order" do
+ simulate_platform x64_mac
+
+ update_repo2 do
+ build_gem "fspath", "3"
+ build_gem "image_optim_pack", "1.2.3" do |s|
+ s.add_runtime_dependency "fspath", ">= 2.1", "< 4"
+ end
+ build_gem "image_optim_pack", "1.2.3" do |s|
+ s.platform = "universal-darwin"
+ s.add_runtime_dependency "fspath", "< 4", ">= 2.1"
+ end
+ end
+
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo2)}"
+ G
+
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo2)}"
+
+ gem "image_optim_pack"
+ G
+
+ expect(err).not_to include "Unable to use the platform-specific"
+
+ expect(the_bundle).to include_gem "image_optim_pack 1.2.3 universal-darwin"
+ end
+
it "fetches gems again after changing the version of Ruby" do
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"