diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-12-14 19:49:16 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2019-12-15 16:41:10 +0900 |
commit | 38002a8adbd98266426940d829429a30af0622a4 (patch) | |
tree | db01bcc2653ba0230a07345c4a3c877246dfe473 /spec/bundler/runtime/inline_spec.rb | |
parent | e2b192f7d5b4f0e2133bb6cf03cfc609258826be (diff) | |
download | ruby-38002a8adbd98266426940d829429a30af0622a4.tar.gz |
Prepare to release bundler-2.1.0
Diffstat (limited to 'spec/bundler/runtime/inline_spec.rb')
-rw-r--r-- | spec/bundler/runtime/inline_spec.rb | 22 |
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 |