summaryrefslogtreecommitdiff
path: root/spec/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'spec/runtime')
-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
6 files changed, 43 insertions, 43 deletions
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