summaryrefslogtreecommitdiff
path: root/spec/cache
diff options
context:
space:
mode:
authorAlex Taylor <alexmctaylorpants@gmail.com>2017-04-21 10:15:35 -0700
committerAlex Taylor <alexmctaylorpants@gmail.com>2017-04-21 10:57:00 -0700
commit9be3a304359cd81956c14f33ab905084a128d866 (patch)
tree6e9748d28704262f733e5bff116d736d1518b3e0 /spec/cache
parent60fbceb1e3632cc5efbbd76a747726ee20347fb6 (diff)
downloadbundler-9be3a304359cd81956c14f33ab905084a128d866.tar.gz
Ensure pre-existing Git caches are updated from remote source
Diffstat (limited to 'spec/cache')
-rw-r--r--spec/cache/git_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb
index b256c8d90f..31b3816a3b 100644
--- a/spec/cache/git_spec.rb
+++ b/spec/cache/git_spec.rb
@@ -93,6 +93,33 @@ end
expect(out).to eq("CACHE")
end
+ it "tracks updates when specifying the gem" do
+ git = build_git "foo"
+ old_ref = git.ref_for("master", 11)
+
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
+
+ bundle "#{cmd} --all"
+
+ update_git "foo" do |s|
+ s.write "lib/foo.rb", "puts :CACHE"
+ end
+
+ ref = git.ref_for("master", 11)
+ expect(ref).not_to eq(old_ref)
+
+ bundle "update foo"
+
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
+
+ FileUtils.rm_rf lib_path("foo-1.0")
+ run "require 'foo'"
+ expect(out).to eq("CACHE")
+ end
+
it "uses the local repository to generate the cache" do
git = build_git "foo"
ref = git.ref_for("master", 11)