diff options
author | Andre Arko <website+github.com@arko.net> | 2011-10-28 12:54:04 -0700 |
---|---|---|
committer | Andre Arko <website+github.com@arko.net> | 2011-10-28 12:54:04 -0700 |
commit | 6c3e0a9a949c7cea4b7ef861d411ff9f90f26080 (patch) | |
tree | 9fa852cd8e4727486bf8b6237d1f53b346db4d14 /spec | |
parent | 15b6c951ff807cc057f71abd92e1bed5d9129491 (diff) | |
parent | 35eee2b421066c234c4fba8904681e2685a9c3bb (diff) | |
download | bundler-6c3e0a9a949c7cea4b7ef861d411ff9f90f26080.tar.gz |
Merge pull request #1491 from carlhuda/1490_bundle_clean_git_7_char
Check for 7 char length git revision for bundle clean
Diffstat (limited to 'spec')
-rw-r--r-- | spec/other/clean_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/other/clean_spec.rb b/spec/other/clean_spec.rb index c36825752d..b004a2f433 100644 --- a/spec/other/clean_spec.rb +++ b/spec/other/clean_spec.rb @@ -394,4 +394,34 @@ describe "bundle clean" do out.should_not include("foo (1.0)") out.should include("rack (1.0.0)") end + + it "cleans git gems with a 7 length git revision" do + build_git "foo" + revision = revision_for(lib_path("foo-1.0")) + + gemfile <<-G + source "file://#{gem_repo1}" + + gem "foo", :git => "#{lib_path('foo-1.0')}" + G + + bundle "install --path vendor/bundle --no-clean" + + # mimic 7 length git revisions in Gemfile.lock + gemfile_lock = File.read(bundled_app('Gemfile.lock')).split("\n") + gemfile_lock.each_with_index do |line, index| + gemfile_lock[index] = line[0..(11 + 7)] if line.include?(" revision:") + end + File.open(bundled_app('Gemfile.lock'), 'w') do |file| + file.print gemfile_lock.join("\n") + end + + bundle "install --path vendor/bundle --no-clean" + + bundle :clean + + out.should_not include("Removing foo (1.0 #{revision[0..6]})") + + vendored_gems("bundler/gems/foo-1.0-#{revision[0..6]}").should exist + end end |