From 9be3a304359cd81956c14f33ab905084a128d866 Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Fri, 21 Apr 2017 10:15:35 -0700 Subject: Ensure pre-existing Git caches are updated from remote source --- spec/cache/git_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'spec/cache') 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) -- cgit v1.2.1