summaryrefslogtreecommitdiff
path: root/spec/cache
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-04-20 11:57:52 -0700
committerAndre Arko <andre@arko.net>2010-04-23 10:03:53 -0700
commit2af6b5720f9fec230d9af5f5aab5125683a13519 (patch)
treeaa2552b08484e60ad7377e6a7af5b4dab003ee37 /spec/cache
parenta20c08aee8a8a727ecc94b9ae9e556fb4eb32dc9 (diff)
downloadbundler-2af6b5720f9fec230d9af5f5aab5125683a13519.tar.gz
Cache command now prunes stale .gem files from vendor/cache
If you don't want to prune, pass --no-prune to either cache or pack
Diffstat (limited to 'spec/cache')
-rw-r--r--spec/cache/gems_spec.rb50
1 files changed, 49 insertions, 1 deletions
diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb
index a0556361fe..54b0255b9e 100644
--- a/spec/cache/gems_spec.rb
+++ b/spec/cache/gems_spec.rb
@@ -1,6 +1,7 @@
require "spec_helper"
-describe "bundle cache with gems" do
+describe "bundle cache" do
+
describe "when there are only gemsources" do
before :each do
gemfile <<-G
@@ -69,4 +70,51 @@ describe "bundle cache with gems" do
end
end
+ describe "when previously cached" do
+ before :each do
+ build_repo2
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "rack"
+ gem "actionpack"
+ G
+ bundle :cache
+ cached_gem("rack-1.0.0").should exist
+ cached_gem("actionpack-2.3.2").should exist
+ cached_gem("activesupport-2.3.2").should exist
+ end
+
+ it "re-caches during install" do
+ cached_gem("rack-1.0.0").rmtree
+ bundle :install
+ out.should include("Copying .gem files into vendor/cache")
+ cached_gem("rack-1.0.0").should exist
+ end
+
+ it "adds updated gems" do
+ update_repo2
+ bundle :install
+ cached_gem("rack-1.2").should exist
+ end
+
+ it "adds new gems and dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "rails"
+ G
+ cached_gem("rails-2.3.2").should exist
+ cached_gem("activerecord-2.3.2").should exist
+ end
+
+ it "removes .gems for removed gems and dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "rack"
+ G
+ cached_gem("rack-1.0.0").should exist
+ cached_gem("actionpack-2.3.2").should_not exist
+ cached_gem("activesupport-2.3.2").should_not exist
+ end
+ end
+
end \ No newline at end of file