summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/source/git.rb10
-rw-r--r--lib/bundler/source/path.rb13
-rw-r--r--spec/bundler/install/gemspecs_spec.rb20
3 files changed, 30 insertions, 13 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 198e335bb6..1eda282e75 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -32,6 +32,16 @@ module Bundler
@local = false
end
+ def remote!
+ @local_specs = nil
+ @allow_remote = true
+ end
+
+ def cached!
+ @local_specs = nil
+ @allow_cached = true
+ end
+
def self.from_lock(options)
new(options.merge("uri" => options.delete("remote")))
end
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 978b0b2c9f..754eaa39c4 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -18,9 +18,6 @@ module Bundler
@options = options.dup
@glob = options["glob"] || DEFAULT_GLOB
- @allow_cached = false
- @allow_remote = false
-
@root_path = options["root_path"] || root
if options["path"]
@@ -41,16 +38,6 @@ module Bundler
@original_path = @path
end
- def remote!
- @local_specs = nil
- @allow_remote = true
- end
-
- def cached!
- @local_specs = nil
- @allow_cached = true
- end
-
def self.from_lock(options)
new(options.merge("path" => options.delete("remote")))
end
diff --git a/spec/bundler/install/gemspecs_spec.rb b/spec/bundler/install/gemspecs_spec.rb
index 51aa0ed14f..420b34ca04 100644
--- a/spec/bundler/install/gemspecs_spec.rb
+++ b/spec/bundler/install/gemspecs_spec.rb
@@ -157,5 +157,25 @@ RSpec.describe "bundle install" do
expect(err).to include("but your Gemfile specified")
expect(exitstatus).to eq(18)
end
+
+ it "validates gemspecs just once when everything installed and lockfile up to date" do
+ build_lib "foo"
+
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo1)}"
+ gemspec path: "#{lib_path("foo-1.0")}"
+
+ module Monkey
+ def validate(spec)
+ puts "Validate called on \#{spec.full_name}"
+ end
+ end
+ Bundler.rubygems.extend(Monkey)
+ G
+
+ bundle "install"
+
+ expect(out).to include("Validate called on foo-1.0").once
+ end
end
end