diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-16 08:45:11 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-17 17:08:51 +0900 |
commit | 08c58e3c0db8aaa6b573fe6c34a6318a17a83c68 (patch) | |
tree | 38f941b7a98f9b8f1f48660a9d58010d407951d1 /spec/bundler | |
parent | a2d7c97a9187f3d88230e273756ed4836fa8ac19 (diff) | |
download | ruby-08c58e3c0db8aaa6b573fe6c34a6318a17a83c68.tar.gz |
[bundler/bundler] Extract a `gemspec_dir` helper
https://github.com/bundler/bundler/commit/71a29e286a
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/commands/newgem_spec.rb | 3 | ||||
-rw-r--r-- | spec/bundler/support/path.rb | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 2ade1653fc..beb21f9c2b 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/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/bundler/support/path.rb b/spec/bundler/support/path.rb index 73d828cb5d..9493c5422a 100644 --- a/spec/bundler/support/path.rb +++ b/spec/bundler/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 |