aboutsummaryrefslogtreecommitdiffstats
path: root/spec/other/clean_spec.rb
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2012-09-14 10:41:42 +0900
committerTerence Lee <hone02@gmail.com>2012-09-14 10:41:42 +0900
commit9afd8849f50957a06f10498caa556d076a55f680 (patch)
tree90695a93d9181c824d0a8f9c667264a596f2c6ae /spec/other/clean_spec.rb
parent7dd2ad05eb685ebf73b3de2cf4316fcddc5ad0b6 (diff)
downloadbundler-9afd8849f50957a06f10498caa556d076a55f680.tar.gz
Revert "`clean` should not remove gems in the lockfile"
This reverts commit aefa530cdc7b209bc646e98b7a730078d064665f. bundle clean should remove BUNDLE_WITHOUT gems. BUNDLE_WITHOUT settings should be standardized across commands as well if you are using BUNDLE_WITHOUT you probably don't want the gems to be around when cleaning.
Diffstat (limited to 'spec/other/clean_spec.rb')
-rw-r--r--spec/other/clean_spec.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/other/clean_spec.rb b/spec/other/clean_spec.rb
index fc8bd778..35a5339c 100644
--- a/spec/other/clean_spec.rb
+++ b/spec/other/clean_spec.rb
@@ -100,6 +100,29 @@ describe "bundle clean" do
vendored_gems("bin/rackup").should exist
end
+ it "remove gems in bundle without groups" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "foo"
+
+ group :test_group do
+ gem "rack", "1.0.0"
+ end
+ G
+
+ bundle "install --path vendor/bundle"
+ bundle "install --without test_group"
+ bundle :clean
+
+ out.should eq("Removing rack (1.0.0)")
+
+ should_have_gems 'foo-1.0'
+ should_not_have_gems 'rack-1.0.0'
+
+ vendored_gems("bin/rackup").should_not exist
+ end
+
it "does not remove cached git dir if it's being used" do
build_git "foo"
revision = revision_for(lib_path("foo-1.0"))
@@ -231,7 +254,7 @@ describe "bundle clean" do
out.should eq("")
vendored_gems("bundler/gems/foo-#{revision[0..11]}").should exist
digest = Digest::SHA1.hexdigest(git_path.to_s)
- vendored_gems("cache/bundler/git/foo-#{digest}").should exist
+ vendored_gems("cache/bundler/git/foo-#{digest}").should_not exist
end
it "does not blow up when using without groups" do