summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authortomhuda <tomhuda@tilde.io>2012-03-07 00:51:31 -0800
committertomhuda <tomhuda@tilde.io>2012-03-07 00:51:31 -0800
commite31a1c7b24d3dfbce7ed39b6a723dd20f7d08c95 (patch)
tree89802ff67e901587aa019ca36c4bdd722c60fe69 /spec/support
parent6d4962dbad7c620045a02393a5878b29ab11a55b (diff)
downloadbundler-e31a1c7b24d3dfbce7ed39b6a723dd20f7d08c95.tar.gz
Clean up corrupted lockfiles
Bundler 1.1.pre.5 introduced a bug that could introduce duplicate GIT sections, which then caused duplicate copies of gems in the GIT sections. This commit makes the LockfileParser aware of the bug, and has it clean up any corrupted lockfiles.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 1466dc992a..c7f5c5bcdc 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -162,6 +162,12 @@ module Spec
end
end
+ def strip_whitespace(str)
+ # Trim the leading spaces
+ spaces = str[/\A\s+/, 0] || ""
+ str.gsub(/^#{spaces}/, '')
+ end
+
def install_gemfile(*args)
gemfile(*args)
opts = args.last.is_a?(Hash) ? args.last : {}