summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-03-28 19:18:40 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-03-28 19:18:40 -0500
commitd4faf61a3a8a7655a9765596e1e811053f93ef8c (patch)
tree188586283e4212d43c98bdc740741019f4a13ec4
parentd716a0ada398f53cd0ecf5e1708d10426e3833eb (diff)
downloadbundler-seg-speed-up-specs-update-repo.tar.gz
[Builders] Dont rebuild gem index when unnecessaryseg-speed-up-specs-update-repo
This should speed up the specs slightly
-rw-r--r--spec/support/builders.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/support/builders.rb b/spec/support/builders.rb
index c43e410c88..54f6889be7 100644
--- a/spec/support/builders.rb
+++ b/spec/support/builders.rb
@@ -300,13 +300,13 @@ module Spec
# A repo that has no pre-installed gems included. (The caller completely
# determines the contents with the block.)
- def build_repo4
+ def build_repo4(&blk)
FileUtils.rm_rf gem_repo4
- build_repo(gem_repo4) { yield }
+ build_repo(gem_repo4, &blk)
end
- def update_repo4
- update_repo(gem_repo4) { yield }
+ def update_repo4(&blk)
+ update_repo(gem_repo4, &blk)
end
def update_repo2
@@ -354,12 +354,14 @@ module Spec
end
def update_repo(path)
+ return unless block_given?
@_build_path = "#{path}/gems"
yield
- @_build_path = nil
with_gem_path_as Path.base_system_gems do
Dir.chdir(path) { gem_command :generate_index }
end
+ ensure
+ @_build_path = nil
end
def build_index(&block)