summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 18:54:15 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:43:54 +0200
commita4beba4cbfc837f7b3b5fb35b95d0521255e8584 (patch)
treef1c3faec6a002e21f499d380a673272d8beb7e32
parentf20c2bdf6a877eb1ad6e0b90f6483cef3480fee8 (diff)
downloadbundler-a4beba4cbfc837f7b3b5fb35b95d0521255e8584.tar.gz
Extract a `root_gemspec` local variable
-rw-r--r--spec/support/path.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/support/path.rb b/spec/support/path.rb
index 38d8ff8102..73d828cb5d 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -134,11 +134,12 @@ module Spec
def with_root_gemspec
if ruby_core?
+ root_gemspec = root.join("bundler.gemspec")
spec = Gem::Specification.load(gemspec.to_s)
spec.bindir = "libexec"
- File.open(root.join("bundler.gemspec").to_s, "w") {|f| f.write spec.to_ruby }
- yield(root.join("bundler.gemspec"))
- FileUtils.rm(root.join("bundler.gemspec"))
+ File.open(root_gemspec.to_s, "w") {|f| f.write spec.to_ruby }
+ yield(root_gemspec)
+ FileUtils.rm(root_gemspec)
else
yield(gemspec)
end