diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-01-08 16:11:52 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2020-01-08 18:00:32 +0900 |
commit | 13f4f07f215ca66cc727c75e0c3d77389c261e14 (patch) | |
tree | ebc5d3ad100f4e48773757460ddee256f0035fcb /spec/bundler/runtime | |
parent | f518b608d64d08024139e8259f5c7b77e630bfff (diff) |
Merge bundler-2.1.4
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2822
Diffstat (limited to 'spec/bundler/runtime')
-rw-r--r-- | spec/bundler/runtime/gem_tasks_spec.rb | 14 | ||||
-rw-r--r-- | spec/bundler/runtime/inline_spec.rb | 17 | ||||
-rw-r--r-- | spec/bundler/runtime/require_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/runtime/setup_spec.rb | 29 |
4 files changed, 56 insertions, 6 deletions
diff --git a/spec/bundler/runtime/gem_tasks_spec.rb b/spec/bundler/runtime/gem_tasks_spec.rb index 4b92de76bb..74270a2316 100644 --- a/spec/bundler/runtime/gem_tasks_spec.rb +++ b/spec/bundler/runtime/gem_tasks_spec.rb @@ -57,6 +57,20 @@ RSpec.describe "require 'bundler/gem_tasks'" do expect(err).to be_empty end + context "rake build when path has spaces" do + before do + spaced_bundled_app = tmp.join("bundled app") + FileUtils.mv bundled_app, spaced_bundled_app + Dir.chdir(spaced_bundled_app) + end + + it "still runs successfully" do + bundle! "exec rake build" + + expect(err).to be_empty + end + end + it "adds 'pkg' to rake/clean's CLOBBER" do with_gem_path_as(Spec::Path.base_system_gems.to_s) do sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect') diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb index 94d8b086a2..cd762fe636 100644 --- a/spec/bundler/runtime/inline_spec.rb +++ b/spec/bundler/runtime/inline_spec.rb @@ -333,4 +333,21 @@ RSpec.describe "bundler/inline#gemfile" do expect(last_command).to be_success expect(out).to include("BUNDLE_GEMFILE is empty") end + + it "resets BUNDLE_GEMFILE to the empty string if it wasn't set previously" do + ENV["BUNDLE_GEMFILE"] = nil + 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 diff --git a/spec/bundler/runtime/require_spec.rb b/spec/bundler/runtime/require_spec.rb index 490b8c7631..a8d7826123 100644 --- a/spec/bundler/runtime/require_spec.rb +++ b/spec/bundler/runtime/require_spec.rb @@ -168,7 +168,6 @@ RSpec.describe "Bundler.require" do build_lib "jquery-rails", "1.0.0" do |s| s.write "lib/jquery/rails.rb", "puts 'jquery/rails'" end - lib_path("jquery-rails-1.0.0/lib/jquery-rails.rb").rmtree end it "requires gem names that are namespaced" do @@ -241,7 +240,6 @@ RSpec.describe "Bundler.require" do build_lib "load-fuuu", "1.0.0" do |s| s.write "lib/load/fuuu.rb", "raise LoadError.new(\"cannot load such file -- load-bar\")" end - lib_path("load-fuuu-1.0.0/lib/load-fuuu.rb").rmtree gemfile <<-G path "#{lib_path}" do diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index 39240b7404..7f00a63078 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -899,17 +899,17 @@ end describe "with git gems that don't have gemspecs" do before :each do - build_git "no-gemspec", :gemspec => false + build_git "no_gemspec", :gemspec => false install_gemfile <<-G - gem "no-gemspec", "1.0", :git => "#{lib_path("no-gemspec-1.0")}" + gem "no_gemspec", "1.0", :git => "#{lib_path("no_gemspec-1.0")}" G end it "loads the library via a virtual spec" do run <<-R - require 'no-gemspec' - puts NOGEMSPEC + require 'no_gemspec' + puts NO_GEMSPEC R expect(out).to eq("1.0") @@ -1263,6 +1263,27 @@ end expect(out).to eq("{}") end + it "does not load net-http-pipeline too early" do + build_repo4 do + build_gem "net-http-pipeline", "1.0.1" + end + + system_gems "net-http-pipeline-1.0.1", :gem_repo => gem_repo4 do + gemfile <<-G + source "#{file_uri_for(gem_repo4)}" + gem "net-http-pipeline", "1.0.1" + G + + bundle "config set --local path vendor/bundle" + + bundle! :install + + bundle! :check + + expect(out).to eq("The Gemfile's dependencies are satisfied") + end + end + Gem::Specification.select(&:default_gem?).map(&:name).each do |g| it "activates newer versions of #{g}" do skip if exemptions.include?(g) |