summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:45:11 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:45:11 +0200
commit71a29e286a34204e808eaf5910b6b23e2a467e2b (patch)
tree7537fa489fc1ef1e68fdd2c19918e6dc4ce38e66
parent948a863bd8ba237b71f647a4815eedb0befd9ab6 (diff)
downloadbundler-refactor_ruby_core_integration.tar.gz
Extract a `gemspec_dir` helperrefactor_ruby_core_integration
-rw-r--r--spec/commands/newgem_spec.rb3
-rw-r--r--spec/support/path.rb4
2 files changed, 5 insertions, 2 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 2ade1653fc..beb21f9c2b 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -309,8 +309,7 @@ RSpec.describe "bundle gem" do
end
it "sets a minimum ruby version" do
- gemspec_path = ruby_core? ? "../../../lib/bundler" : "../.."
- bundler_gemspec = Bundler::GemHelper.new(File.expand_path(gemspec_path, __dir__)).gemspec
+ bundler_gemspec = Bundler::GemHelper.new(gemspec_dir).gemspec
expect(bundler_gemspec.required_ruby_version).to eq(generated_gemspec.required_ruby_version)
end
diff --git a/spec/support/path.rb b/spec/support/path.rb
index 73d828cb5d..9493c5422a 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -13,6 +13,10 @@ module Spec
@gemspec ||= root.join(ruby_core? ? "lib/bundler/bundler.gemspec" : "bundler.gemspec")
end
+ def gemspec_dir
+ @gemspec_dir ||= gemspec.parent
+ end
+
def bindir
@bindir ||= root.join(ruby_core? ? "libexec" : "exe")
end