summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-06 17:56:05 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-06 17:56:05 -0700
commit388ed7e3c655c7c21247d5760fd23ad3829a3a8e (patch)
tree4a5342bfc5666d14e5f4a26672deed22b403562d
parent2332b7a8fa1f4e597f100a74df1a32ecb79b5fa8 (diff)
downloadbundler-388ed7e3c655c7c21247d5760fd23ad3829a3a8e.tar.gz
bundle update should not explode if a Gemfile.lock does not exist (closes #423)
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--spec/update/gems_spec.rb18
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 2bbffd85b3..3176d0f2da 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -131,7 +131,7 @@ module Bundler
if gems.empty? && sources.empty?
# We're doing a full update
- FileUtils.rm Bundler.root.join("Gemfile.lock")
+ FileUtils.rm_f Bundler.root.join("Gemfile.lock")
else
Bundler.definition(:gems => gems, :sources => sources)
end
diff --git a/spec/update/gems_spec.rb b/spec/update/gems_spec.rb
index 9e73138a2f..92b39aed4a 100644
--- a/spec/update/gems_spec.rb
+++ b/spec/update/gems_spec.rb
@@ -32,4 +32,20 @@ describe "bundle update" do
should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 2.3.5"
end
end
-end \ No newline at end of file
+end
+
+describe "bundle update without a Gemfile.lock" do
+ it "should not explode" do
+ build_repo2
+
+ gemfile <<-G
+ source "file://#{gem_repo2}"
+
+ gem "rack", "1.0"
+ G
+
+ bundle "update"
+
+ should_be_installed "rack 1.0.0"
+ end
+end