summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-05-03 11:35:00 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-05-03 11:35:00 -0500
commitaeec3437f20c70624d778a7c40e0525dd69d3933 (patch)
tree2623b3db07b811e67efa7b8031641eed5d215dde
parentaf277266db3fac8c0dd52c8bb0bd2ba63ae78131 (diff)
downloadbundler-seg-gem-finish-resolve.tar.gz
[RubygemsIntegration] Stub out Gem.finish_resolveseg-gem-finish-resolve
-rw-r--r--lib/bundler/rubygems_integration.rb4
-rw-r--r--spec/install/gemfile/gemspec_spec.rb24
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 7283a326dd..e33ae41b50 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -698,6 +698,10 @@ module Bundler
Gem.post_reset do
Gem::Specification.all = specs
end
+
+ redefine_method((class << Gem; self; end), :finish_resolve) do |*|
+ []
+ end
end
def all_specs
diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb
index e2534be1ad..1ea613c9d2 100644
--- a/spec/install/gemfile/gemspec_spec.rb
+++ b/spec/install/gemfile/gemspec_spec.rb
@@ -231,6 +231,30 @@ RSpec.describe "bundle install from an existing gemspec" do
expect(the_bundle).to include_gems "foo 1.0.0"
end
+ it "does not break Gem.finish_resolve with conflicts", :rubygems => ">= 2" do
+ build_lib("foo", :path => tmp.join("foo")) do |s|
+ s.version = "1.0.0"
+ s.add_dependency "bar", "= 1.0.0"
+ end
+ build_repo2 do
+ build_gem "deps" do |s|
+ s.add_dependency "foo", "= 0.0.1"
+ end
+ build_gem "foo", "0.0.1"
+ end
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo2}"
+ gem "deps"
+ gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
+ G
+
+ expect(the_bundle).to include_gems "foo 1.0.0"
+
+ run! "Gem.finish_resolve; puts 'WIN'"
+ expect(out).to eq("WIN")
+ end
+
context "in deployment mode" do
context "when the lockfile was not updated after a change to the gemspec's dependencies" do
it "reports that installation failed" do