aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support/path.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/support/path.rb')
-rw-r--r--spec/bundler/support/path.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index 3b18cd2da8..38d8ff8102 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -132,6 +132,18 @@ module Spec
tmp "tmpdir", *args
end
+ def with_root_gemspec
+ if ruby_core?
+ 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"))
+ else
+ yield(gemspec)
+ end
+ end
+
def ruby_core?
# avoid to wornings
@ruby_core ||= nil