summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-30 18:23:54 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-04 17:49:26 +0100
commit8587a5e8505ea36ab840afc6d47413e44522931e (patch)
tree1d322255720e477af1ca58154a1f8413199b4ccd
parent13ed83f6d40fa30bffa7496d85f0dcd03452f4ed (diff)
downloadbundler-8587a5e8505ea36ab840afc6d47413e44522931e.tar.gz
Rename `lib` to `lib_dir`
For consistency with `spec_dir`.
-rw-r--r--spec/bundler/shared_helpers_spec.rb2
-rw-r--r--spec/commands/exec_spec.rb6
-rw-r--r--spec/commands/newgem_spec.rb2
-rw-r--r--spec/install/gemfile/groups_spec.rb2
-rw-r--r--spec/realworld/double_check_spec.rb4
-rw-r--r--spec/realworld/edgecases_spec.rb6
-rw-r--r--spec/runtime/gem_tasks_spec.rb4
-rw-r--r--spec/runtime/inline_spec.rb6
-rw-r--r--spec/runtime/load_spec.rb2
-rw-r--r--spec/runtime/require_spec.rb2
-rw-r--r--spec/runtime/setup_spec.rb60
-rw-r--r--spec/runtime/with_unbundled_env_spec.rb12
-rw-r--r--spec/support/artifice/endpoint.rb2
-rw-r--r--spec/support/helpers.rb8
-rw-r--r--spec/support/path.rb2
15 files changed, 60 insertions, 60 deletions
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb
index 0340cb7bae..4530a9a5cd 100644
--- a/spec/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/shared_helpers_spec.rb
@@ -236,7 +236,7 @@ RSpec.describe Bundler::SharedHelpers do
shared_examples_for "ENV['RUBYOPT'] gets set correctly" do
it "ensures -rbundler/setup is at the beginning of ENV['RUBYOPT']" do
subject.set_bundle_environment
- expect(ENV["RUBYOPT"].split(" ")).to start_with("-r#{lib}/bundler/setup")
+ expect(ENV["RUBYOPT"].split(" ")).to start_with("-r#{lib_dir}/bundler/setup")
end
end
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index cf76d3fb93..7ae504d360 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -89,7 +89,7 @@ RSpec.describe "bundle exec" do
else
require 'tempfile'
io = Tempfile.new("io-test-fd")
- args = %W[#{Gem.ruby} -I#{lib} #{bindir.join("bundle")} exec --keep-file-descriptors #{Gem.ruby} #{command.path} \#{io.to_i}]
+ args = %W[#{Gem.ruby} -I#{lib_dir} #{bindir.join("bundle")} exec --keep-file-descriptors #{Gem.ruby} #{command.path} \#{io.to_i}]
args << { io.to_i => io }
exec(*args)
end
@@ -279,7 +279,7 @@ RSpec.describe "bundle exec" do
G
rubyopt = ENV["RUBYOPT"]
- rubyopt = "-r#{lib}/bundler/setup #{rubyopt}"
+ rubyopt = "-r#{lib_dir}/bundler/setup #{rubyopt}"
bundle "exec 'echo $RUBYOPT'"
expect(out).to have_rubyopts(rubyopt)
@@ -294,7 +294,7 @@ RSpec.describe "bundle exec" do
G
rubylib = ENV["RUBYLIB"]
- rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift lib.to_s
+ rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift lib_dir.to_s
rubylib = rubylib.uniq.join(File::PATH_SEPARATOR)
bundle "exec 'echo $RUBYLIB'"
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 52a6c11972..493d300eb1 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -181,7 +181,7 @@ RSpec.describe "bundle gem" do
context "when git is not available" do
# This spec cannot have `git` available in the test env
before do
- load_paths = [lib, spec_dir]
+ load_paths = [lib_dir, spec_dir]
load_path_str = "-I#{load_paths.join(File::PATH_SEPARATOR)}"
sys_exec "#{Gem.ruby} #{load_path_str} #{bindir.join("bundle")} gem #{gem_name}", "PATH" => ""
diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb
index 93798ef62e..63be1a4e43 100644
--- a/spec/install/gemfile/groups_spec.rb
+++ b/spec/install/gemfile/groups_spec.rb
@@ -333,7 +333,7 @@ RSpec.describe "bundle install with groups" do
G
ruby <<-R
- require "#{lib}/bundler"
+ require "#{lib_dir}/bundler"
Bundler.setup :default
Bundler.require :default
puts RACK
diff --git a/spec/realworld/double_check_spec.rb b/spec/realworld/double_check_spec.rb
index ce12d1566f..90cf298b33 100644
--- a/spec/realworld/double_check_spec.rb
+++ b/spec/realworld/double_check_spec.rb
@@ -25,9 +25,9 @@ RSpec.describe "double checking sources", :realworld => true, :sometimes => true
RUBY
cmd = <<-RUBY
- require "#{lib}/bundler"
+ require "#{lib_dir}/bundler"
require "#{spec_dir}/support/artifice/vcr"
- require "#{lib}/bundler/inline"
+ require "#{lib_dir}/bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "rails", path: "."
diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb
index dfddd124d8..53d9f9a026 100644
--- a/spec/realworld/edgecases_spec.rb
+++ b/spec/realworld/edgecases_spec.rb
@@ -4,9 +4,9 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
def rubygems_version(name, requirement)
ruby! <<-RUBY
require "#{spec_dir}/support/artifice/vcr"
- require "#{lib}/bundler"
- require "#{lib}/bundler/source/rubygems/remote"
- require "#{lib}/bundler/fetcher"
+ require "#{lib_dir}/bundler"
+ require "#{lib_dir}/bundler/source/rubygems/remote"
+ require "#{lib_dir}/bundler/fetcher"
rubygem = Bundler.ui.silence do
source = Bundler::Source::Rubygems::Remote.new(URI("https://rubygems.org"))
fetcher = Bundler::Fetcher.new(source)
diff --git a/spec/runtime/gem_tasks_spec.rb b/spec/runtime/gem_tasks_spec.rb
index af645c8ef1..4760b6a749 100644
--- a/spec/runtime/gem_tasks_spec.rb
+++ b/spec/runtime/gem_tasks_spec.rb
@@ -11,7 +11,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do
end
bundled_app("Rakefile").open("w") do |f|
f.write <<-RAKEFILE
- $:.unshift("#{lib}")
+ $:.unshift("#{lib_dir}")
require "bundler/gem_tasks"
RAKEFILE
end
@@ -19,7 +19,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do
it "includes the relevant tasks" do
with_gem_path_as(Spec::Path.base_system_gems.to_s) do
- sys_exec "#{rake} -T", "RUBYOPT" => "-I#{lib}"
+ sys_exec "#{rake} -T", "RUBYOPT" => "-I#{lib_dir}"
end
expect(err).to eq("")
diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb
index 92243a77b6..301e2e9c0b 100644
--- a/spec/runtime/inline_spec.rb
+++ b/spec/runtime/inline_spec.rb
@@ -2,7 +2,7 @@
RSpec.describe "bundler/inline#gemfile" do
def script(code, options = {})
- requires = ["#{lib}/bundler/inline"]
+ requires = ["#{lib_dir}/bundler/inline"]
requires.unshift File.expand_path("../../support/artifice/" + options.delete(:artifice) + ".rb", __FILE__) if options.key?(:artifice)
requires = requires.map {|r| "require '#{r}'" }.join("\n")
@out = ruby("#{requires}\n\n" + code, options)
@@ -97,7 +97,7 @@ RSpec.describe "bundler/inline#gemfile" do
it "lets me use my own ui object" do
script <<-RUBY, :artifice => "endpoint"
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
class MyBundlerUI < Bundler::UI::Silent
def confirm(msg, newline = nil)
puts "CONFIRMED!"
@@ -141,7 +141,7 @@ RSpec.describe "bundler/inline#gemfile" do
it "does not mutate the option argument" do
script <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
options = { :ui => Bundler::UI::Shell.new }
gemfile(false, options) do
path "#{lib_path}" do
diff --git a/spec/runtime/load_spec.rb b/spec/runtime/load_spec.rb
index acefc1a583..7de67e247c 100644
--- a/spec/runtime/load_spec.rb
+++ b/spec/runtime/load_spec.rb
@@ -80,7 +80,7 @@ RSpec.describe "Bundler.load" do
G
ruby! <<-RUBY
- require "#{lib}/bundler"
+ require "#{lib_dir}/bundler"
Bundler.setup :default
Bundler.require :default
puts RACK
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb
index 42d0c2db77..490b8c7631 100644
--- a/spec/runtime/require_spec.rb
+++ b/spec/runtime/require_spec.rb
@@ -193,7 +193,7 @@ RSpec.describe "Bundler.require" do
G
cmd = <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.require
RUBY
ruby(cmd)
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index b9d710a9d9..3e6bc5abae 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe "Bundler.setup" do
G
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup
require 'rack'
@@ -34,7 +34,7 @@ RSpec.describe "Bundler.setup" do
it "doesn't make all groups available" do
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup(:default)
begin
@@ -49,7 +49,7 @@ RSpec.describe "Bundler.setup" do
it "accepts string for group name" do
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup(:default, 'test')
require 'rack'
@@ -61,7 +61,7 @@ RSpec.describe "Bundler.setup" do
it "leaves all groups available if they were already" do
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup
Bundler.setup(:default)
@@ -74,7 +74,7 @@ RSpec.describe "Bundler.setup" do
it "leaves :default available if setup is called twice" do
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup(:default)
Bundler.setup(:default, :test)
@@ -91,7 +91,7 @@ RSpec.describe "Bundler.setup" do
it "handles multiple non-additive invocations" do
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup(:default, :test)
Bundler.setup(:default)
require 'rack'
@@ -109,7 +109,7 @@ RSpec.describe "Bundler.setup" do
def clean_load_path(lp)
without_bundler_load_path = ruby!("puts $LOAD_PATH").split("\n")
lp -= without_bundler_load_path
- lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s, lib.to_s}/i, "") }
+ lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s, lib_dir.to_s}/i, "") }
end
it "puts loaded gems after -I and RUBYLIB", :ruby_repo do
@@ -122,7 +122,7 @@ RSpec.describe "Bundler.setup" do
ENV["RUBYLIB"] = "rubylib_dir"
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup
puts $LOAD_PATH
RUBY
@@ -144,7 +144,7 @@ RSpec.describe "Bundler.setup" do
G
ruby! <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup
puts $LOAD_PATH
RUBY
@@ -172,7 +172,7 @@ RSpec.describe "Bundler.setup" do
G
ruby! <<-RUBY
- require '#{lib}/bundler/setup'
+ require '#{lib_dir}/bundler/setup'
puts $LOAD_PATH
RUBY
@@ -193,7 +193,7 @@ RSpec.describe "Bundler.setup" do
G
ruby <<-R
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
begin
Bundler.setup
@@ -213,7 +213,7 @@ RSpec.describe "Bundler.setup" do
G
ruby <<-R
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup
R
@@ -236,7 +236,7 @@ RSpec.describe "Bundler.setup" do
G
ruby <<-R
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
Bundler.setup
R
@@ -289,7 +289,7 @@ RSpec.describe "Bundler.setup" do
ENV["BUNDLE_GEMFILE"] = "Gemfile"
ruby <<-R
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
begin
Bundler.setup
@@ -444,7 +444,7 @@ RSpec.describe "Bundler.setup" do
break_git!
ruby <<-R
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
begin
Bundler.setup
@@ -465,7 +465,7 @@ RSpec.describe "Bundler.setup" do
break_git!
ruby <<-R
- require "#{lib}/bundler"
+ require "#{lib_dir}/bundler"
begin
Bundler.setup
@@ -774,7 +774,7 @@ end
s.class.send(:define_method, :build_extensions) { nil }
end
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
gem '#{gem_name}'
puts $LOAD_PATH.count {|path| path =~ /#{gem_name}/} >= 2
@@ -1028,7 +1028,7 @@ end
bundle "install"
ruby <<-RUBY
- require '#{lib}/bundler'
+ require '#{lib_dir}/bundler'
def Bundler.require(path)
raise "LOSE"
end
@@ -1083,7 +1083,7 @@ end
context "is not present" do
it "does not change the lock" do
lockfile lock_with(nil)
- ruby "require '#{lib}/bundler/setup'"
+ ruby "require '#{lib_dir}/bundler/setup'"
lockfile_should_be lock_with(nil)
end
end
@@ -1091,7 +1091,7 @@ end
context "is newer" do
it "does not change the lock or warn" do
lockfile lock_with(Bundler::VERSION.succ)
- ruby "require '#{lib}/bundler/setup'"
+ ruby "require '#{lib_dir}/bundler/setup'"
expect(out).to eq("")
expect(err).to eq("")
lockfile_should_be lock_with(Bundler::VERSION.succ)
@@ -1101,7 +1101,7 @@ end
context "is older" do
it "does not change the lock" do
lockfile lock_with("1.10.1")
- ruby "require '#{lib}/bundler/setup'"
+ ruby "require '#{lib_dir}/bundler/setup'"
lockfile_should_be lock_with("1.10.1")
end
end
@@ -1148,14 +1148,14 @@ end
context "is not present" do
it "does not change the lock" do
- expect { ruby! "require '#{lib}/bundler/setup'" }.not_to change { lockfile }
+ expect { ruby! "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
end
end
context "is newer" do
let(:ruby_version) { "5.5.5" }
it "does not change the lock or warn" do
- expect { ruby! "require '#{lib}/bundler/setup'" }.not_to change { lockfile }
+ expect { ruby! "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
expect(out).to eq("")
expect(err).to eq("")
end
@@ -1164,7 +1164,7 @@ end
context "is older" do
let(:ruby_version) { "1.0.0" }
it "does not change the lock" do
- expect { ruby! "require '#{lib}/bundler/setup'" }.not_to change { lockfile }
+ expect { ruby! "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
end
end
end
@@ -1173,7 +1173,7 @@ end
it "does not load Psych" do
gemfile ""
ruby <<-RUBY
- require '#{lib}/bundler/setup'
+ require '#{lib_dir}/bundler/setup'
puts defined?(Psych::VERSION) ? Psych::VERSION : "undefined"
require 'psych'
puts Psych::VERSION
@@ -1186,7 +1186,7 @@ end
it "does not load openssl" do
install_gemfile! ""
ruby! <<-RUBY
- require "#{lib}/bundler/setup"
+ require "#{lib_dir}/bundler/setup"
puts defined?(OpenSSL) || "undefined"
require "openssl"
puts defined?(OpenSSL) || "undefined"
@@ -1240,7 +1240,7 @@ end
it "activates no gems with -rbundler/setup" do
install_gemfile! ""
- ruby! code, :env => { :RUBYOPT => activation_warning_hack_rubyopt + " -r#{lib}/bundler/setup" }
+ ruby! code, :env => { :RUBYOPT => activation_warning_hack_rubyopt + " -r#{lib_dir}/bundler/setup" }
expect(out).to eq("{}")
end
@@ -1315,7 +1315,7 @@ end
G
ruby! <<-RUBY
- require "#{lib}/bundler/setup"
+ require "#{lib_dir}/bundler/setup"
Object.new.gem "rack"
puts Gem.loaded_specs["rack"].full_name
RUBY
@@ -1330,7 +1330,7 @@ end
G
ruby <<-RUBY
- require "#{lib}/bundler/setup"
+ require "#{lib_dir}/bundler/setup"
Object.new.gem "rack"
puts "FAIL"
RUBY
@@ -1346,7 +1346,7 @@ end
G
ruby <<-RUBY
- require "#{lib}/bundler/setup"
+ require "#{lib_dir}/bundler/setup"
Object.new.require "rack"
puts "FAIL"
RUBY
diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb
index 2cb0a0e4a3..66d81b3d0d 100644
--- a/spec/runtime/with_unbundled_env_spec.rb
+++ b/spec/runtime/with_unbundled_env_spec.rb
@@ -170,7 +170,7 @@ RSpec.describe "Bundler.with_env helpers" do
end
it "runs system inside with_original_env" do
- system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib} -rbundler -e '#{code}'")
+ system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib_dir} -rbundler -e '#{code}'")
expect($?.exitstatus).to eq(42)
end
end
@@ -185,7 +185,7 @@ RSpec.describe "Bundler.with_env helpers" do
end
it "runs system inside with_clean_env" do
- system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib} -rbundler -e '#{code}'")
+ system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib_dir} -rbundler -e '#{code}'")
expect($?.exitstatus).to eq(42)
end
end
@@ -200,7 +200,7 @@ RSpec.describe "Bundler.with_env helpers" do
end
it "runs system inside with_unbundled_env" do
- system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib} -rbundler -e '#{code}'")
+ system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib_dir} -rbundler -e '#{code}'")
expect($?.exitstatus).to eq(42)
end
end
@@ -221,7 +221,7 @@ RSpec.describe "Bundler.with_env helpers" do
it "runs exec inside with_original_env" do
skip "Fork not implemented" if Gem.win_platform?
- system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib} -rbundler -e '#{code}'")
+ system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib_dir} -rbundler -e '#{code}'")
expect($?.exitstatus).to eq(0)
end
end
@@ -242,7 +242,7 @@ RSpec.describe "Bundler.with_env helpers" do
it "runs exec inside with_clean_env" do
skip "Fork not implemented" if Gem.win_platform?
- system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib} -rbundler -e '#{code}'")
+ system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib_dir} -rbundler -e '#{code}'")
expect($?.exitstatus).to eq(1)
end
end
@@ -263,7 +263,7 @@ RSpec.describe "Bundler.with_env helpers" do
it "runs exec inside with_clean_env" do
skip "Fork not implemented" if Gem.win_platform?
- system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib} -rbundler -e '#{code}'")
+ system({ "BUNDLE_FOO" => "bar" }, "ruby -I#{lib_dir} -rbundler -e '#{code}'")
expect($?.exitstatus).to eq(1)
end
end
diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb
index 966681f8d8..5ecb784a0a 100644
--- a/spec/support/artifice/endpoint.rb
+++ b/spec/support/artifice/endpoint.rb
@@ -44,7 +44,7 @@ class Endpoint < Sinatra::Base
def dependencies_for(gem_names, gem_repo = GEM_REPO)
return [] if gem_names.nil? || gem_names.empty?
- require "#{Spec::Path.lib}/bundler"
+ require "#{Spec::Path.lib_dir}/bundler"
Bundler::Deprecate.skip_during do
all_specs = %w[specs.4.8 prerelease_specs.4.8].map do |filename|
Marshal.load(File.open(gem_repo.join(filename)).read)
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 0c4dcbbe95..de5ecf1ddc 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -78,7 +78,7 @@ module Spec
def run(cmd, *args)
opts = args.last.is_a?(Hash) ? args.pop : {}
groups = args.map(&:inspect).join(", ")
- setup = "require '#{lib}/bundler' ; Bundler.ui.silence { Bundler.setup(#{groups}) }\n"
+ setup = "require '#{lib_dir}/bundler' ; Bundler.ui.silence { Bundler.setup(#{groups}) }\n"
ruby(setup + cmd, opts)
end
bang :run
@@ -127,7 +127,7 @@ module Spec
requires_str = requires.map {|r| "-r#{r}" }.join(" ")
load_path = []
- load_path << lib unless system_bundler
+ load_path << lib_dir unless system_bundler
load_path << spec_dir
load_path_str = "-I#{load_path.join(File::PATH_SEPARATOR)}"
@@ -174,7 +174,7 @@ module Spec
def ruby(ruby, options = {})
env = (options.delete(:env) || {}).map {|k, v| "#{k}='#{v}' " }.join
ruby = ruby.gsub(/["`\$]/) {|m| "\\#{m}" }
- lib_option = options[:no_lib] ? "" : " -I#{lib}"
+ lib_option = options[:no_lib] ? "" : " -I#{lib_dir}"
sys_exec(%(#{env}#{Gem.ruby}#{lib_option} -e "#{ruby}"))
end
bang :ruby
@@ -191,7 +191,7 @@ module Spec
def gembin(cmd)
old = ENV["RUBYOPT"]
- ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -I#{lib}"
+ ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -I#{lib_dir}"
cmd = bundled_app("bin/#{cmd}") unless cmd.to_s.include?("/")
sys_exec(cmd.to_s)
ensure
diff --git a/spec/support/path.rb b/spec/support/path.rb
index 79b55dd42a..b957e24abe 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -131,7 +131,7 @@ module Spec
tmp("libs", *args)
end
- def lib
+ def lib_dir
root.join("lib")
end