diff options
Diffstat (limited to 'spec/runtime/inline_spec.rb')
-rw-r--r-- | spec/runtime/inline_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 06be2ef83d..94d8b086a2 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/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 |