summaryrefslogtreecommitdiff
path: root/spec/bundler/runtime/setup_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/runtime/setup_spec.rb')
-rw-r--r--spec/bundler/runtime/setup_spec.rb62
1 files changed, 31 insertions, 31 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb
index b9d710a9d9..72ad06a43a 100644
--- a/spec/bundler/runtime/setup_spec.rb
+++ b/spec/bundler/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
@@ -1043,7 +1043,7 @@ end
describe "when Bundler is bundled" do
it "doesn't blow up" do
install_gemfile <<-G
- gem "bundler", :path => "#{File.expand_path("..", lib)}"
+ gem "bundler", :path => "#{root}"
G
bundle %(exec ruby -e "require 'bundler'; Bundler.setup")
@@ -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