diff options
-rw-r--r-- | lib/bundler/definition.rb | 6 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 26 |
3 files changed, 33 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 3dcac64191..0ee27b3ae7 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -167,6 +167,12 @@ module Bundler missing end + def missing_dependencies + missing = [] + resolve.materialize(current_dependencies, missing) + missing + end + def requested_specs @requested_specs ||= begin groups = requested_groups diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 509b7b0cba..fcf68928e4 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -185,7 +185,7 @@ module Bundler local = Bundler.ui.silence do begin tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil) - true unless tmpdef.new_platform? || tmpdef.missing_specs.any? + true unless tmpdef.new_platform? || tmpdef.missing_dependencies.any? rescue BundlerError end end diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index f3a1983740..401da1b1d3 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -14,5 +14,31 @@ describe "bundle install" do expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})") should_be_installed "foo 1.0" end + + it "should check out git repos that are missing but not being installed" do + build_git "foo" + + gemfile <<-G + gem "foo", :git => "file://#{lib_path("foo-1.0")}", :group => :development + G + + lockfile <<-L + GIT + remote: file://#{lib_path("foo-1.0")} + specs: + foo (1.0) + + PLATFORMS + ruby + + DEPENDENCIES + foo! + L + + bundle "install --path=vendor/bundle --without development" + + expect(out).to include("Bundle complete!") + expect(vendored_gems("bundler/gems/foo-1.0-#{revision_for(lib_path("foo-1.0"))[0..11]}")).to be_directory + end end end |