summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/clean_spec.rb24
-rw-r--r--spec/commands/exec_spec.rb2
-rw-r--r--spec/commands/outdated_spec.rb2
-rw-r--r--spec/commands/update_spec.rb1
4 files changed, 28 insertions, 1 deletions
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index be8f80065c..8113ae8c25 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -383,6 +383,30 @@ RSpec.describe "bundle clean" do
should_not_have_gems "foo-1.0"
end
+ it "automatically cleans when path has not been set", :bundler => "2" do
+ build_repo2
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo2}"
+
+ gem "foo"
+ G
+
+ update_repo2 do
+ build_gem "foo", "1.0.1"
+ end
+
+ bundle! "update", :all => true
+
+ files = Pathname.glob(bundled_app(".bundle", Bundler.ruby_scope, "*", "*"))
+ files.map! {|f| f.to_s.sub(bundled_app(".bundle", Bundler.ruby_scope).to_s, "") }
+ expect(files.sort).to eq %w[
+ /cache/foo-1.0.1.gem
+ /gems/foo-1.0.1
+ /specifications/foo-1.0.1.gemspec
+ ]
+ end
+
it "does not clean automatically on --path" do
gemfile <<-G
source "file://#{gem_repo1}"
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index bcc436d39b..61c58e3025 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -617,7 +617,7 @@ RSpec.describe "bundle exec" do
let(:exit_code) { Bundler::GemNotFound.new.status_code }
let(:expected) { <<-EOS.strip }
\e[31mCould not find gem 'rack (= 2)' in locally installed gems.
-The source contains 'rack' at: 0.9.1, 1.0.0\e[0m
+The source contains 'rack' at: 1.0.0\e[0m
\e[33mRun `bundle install` to install missing gems.\e[0m
EOS
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index c7964365a6..f0ad136c98 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -191,6 +191,8 @@ RSpec.describe "bundle outdated" do
build_gem "activesupport", "2.3.4"
end
+ bundle! "config clean false"
+
install_gemfile <<-G
source "file://#{gem_repo2}"
gem "activesupport", "2.3.4"
diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb
index a488be536f..a8283cf593 100644
--- a/spec/commands/update_spec.rb
+++ b/spec/commands/update_spec.rb
@@ -498,6 +498,7 @@ RSpec.describe "bundle update" do
end
bundle! "update", :all => bundle_update_requires_all?
+ out.sub!("Removing foo (1.0)\n", "")
out.gsub!(/RubyGems [\d\.]+ is not threadsafe.*\n?/, "")
expect(out).to include strip_whitespace(<<-EOS).strip
Resolving dependencies...