Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Ensure packaged git repos works when using install with --path option #1989

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions spec/cache/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@

%w(cache package).each do |cmd|
describe "bundle #{cmd} with git" do
it "copies repository to vendor cache and uses it" do
git = build_git "foo"
ref = git.ref_for("master", 11)

install_gemfile <<-G
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
["install", "install --path vendor/bundle"].each do |install_cmd|
it "copies repository to vendor cache and uses it when using #{install_cmd}" do
git = build_git "foo"
ref = git.ref_for("master", 11)

bundle "#{cmd} --all"
bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
bundled_app("vendor/cache/foo-1.0-#{ref}/.git").should_not exist
gemfile <<-G
gem "foo", :git => '#{lib_path("foo-1.0")}'
G

FileUtils.rm_rf lib_path("foo-1.0")
should_be_installed "foo 1.0"
bundle install_cmd
bundle "#{cmd} --all"
bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
bundled_app("vendor/cache/foo-1.0-#{ref}/.git").should_not exist

FileUtils.rm_rf lib_path("foo-1.0")
should_be_installed "foo 1.0"
end
end

it "runs twice without exploding" do
Expand Down Expand Up @@ -121,4 +125,4 @@
should_be_installed "has_submodule 1.0"
end
end
end
end