aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/runtime/inline_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/runtime/inline_spec.rb')
-rw-r--r--spec/bundler/runtime/inline_spec.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb
index 06be2ef83d..94d8b086a2 100644
--- a/spec/bundler/runtime/inline_spec.rb
+++ b/spec/bundler/runtime/inline_spec.rb
@@ -5,7 +5,7 @@ RSpec.describe "bundler/inline#gemfile" do
requires = ["#{lib_dir}/bundler/inline"]
requires.unshift "#{spec_dir}/support/artifice/" + options.delete(:artifice) if options.key?(:artifice)
requires = requires.map {|r| "require '#{r}'" }.join("\n")
- @out = ruby("#{requires}\n\n" + code, options)
+ ruby("#{requires}\n\n" + code, options)
end
before :each do
@@ -88,9 +88,8 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(out).to include("Installing activesupport")
- err.gsub! %r{(.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$)}, ""
err_lines = err.split("\n")
- err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / }
+ err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } unless RUBY_VERSION < "2.7"
expect(err_lines).to be_empty
expect(exitstatus).to be_zero if exitstatus
end
@@ -317,4 +316,21 @@ RSpec.describe "bundler/inline#gemfile" do
expect(err).to be_empty
end
+
+ it "preserves previous BUNDLE_GEMFILE value" do
+ ENV["BUNDLE_GEMFILE"] = ""
+ script <<-RUBY
+ gemfile do
+ source "#{file_uri_for(gem_repo1)}"
+ gem "rack"
+ end
+
+ puts "BUNDLE_GEMFILE is empty" if ENV["BUNDLE_GEMFILE"].empty?
+ system("#{Gem.ruby} -w -e '42'") # this should see original value of BUNDLE_GEMFILE
+ exit $?.exitstatus
+ RUBY
+
+ expect(last_command).to be_success
+ expect(out).to include("BUNDLE_GEMFILE is empty")
+ end
end