mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	
							parent
							
								
									596588c697
								
							
						
					
					
						commit
						ea4824ee0f
					
				
				
				Notes:
				
					git
				
				2020-06-18 19:15:04 +09:00 
				
			
			
			
		
		
					 13 changed files with 33 additions and 33 deletions
				
			
		
							
								
								
									
										2
									
								
								spec/bundler/cache/git_spec.rb
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								spec/bundler/cache/git_spec.rb
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -93,7 +93,7 @@ RSpec.describe "bundle cache with git" do
 | 
			
		|||
    expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
 | 
			
		||||
 | 
			
		||||
    FileUtils.rm_rf lib_path("foo-1.0")
 | 
			
		||||
    run! "require 'foo'"
 | 
			
		||||
    run "require 'foo'"
 | 
			
		||||
    expect(out).to eq("CACHE")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -92,7 +92,7 @@ RSpec.describe ".bundle/config" do
 | 
			
		|||
 | 
			
		||||
    it "can also be set explicitly" do
 | 
			
		||||
      bundle "config set --global foo global"
 | 
			
		||||
      run! "puts Bundler.settings[:foo]"
 | 
			
		||||
      run "puts Bundler.settings[:foo]"
 | 
			
		||||
      expect(out).to eq("global")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -921,7 +921,7 @@ __FILE__: #{path.to_s.inspect}
 | 
			
		|||
          expect(bundle("exec #{file}", :artifice => nil, :env => env)).to eq(expected)
 | 
			
		||||
          expect(bundle("exec bundle exec #{file}", :artifice => nil, :env => env)).to eq(expected)
 | 
			
		||||
          expect(bundle("exec ruby #{file}", :artifice => nil, :env => env)).to eq(expected)
 | 
			
		||||
          expect(run!(file.read, :artifice => nil, :env => env)).to eq(expected)
 | 
			
		||||
          expect(run(file.read, :artifice => nil, :env => env)).to eq(expected)
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        skip "ruby_core has openssl and rubygems in the same folder, and this test needs rubygems require but default openssl not in a directly added entry in $LOAD_PATH" if ruby_core?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -238,7 +238,7 @@ RSpec.describe "install in deployment or frozen mode" do
 | 
			
		|||
      bundle "config --local without development"
 | 
			
		||||
      bundle "config --local deployment true"
 | 
			
		||||
      bundle :install, :env => { "DEBUG" => "1" }
 | 
			
		||||
      run! "puts :WIN"
 | 
			
		||||
      run "puts :WIN"
 | 
			
		||||
      expect(out).to eq("WIN")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -255,7 +255,7 @@ RSpec.describe "bundle install from an existing gemspec" do
 | 
			
		|||
 | 
			
		||||
    expect(the_bundle).to include_gems "foo 1.0.0"
 | 
			
		||||
 | 
			
		||||
    run! "Gem.finish_resolve; puts 'WIN'"
 | 
			
		||||
    run "Gem.finish_resolve; puts 'WIN'"
 | 
			
		||||
    expect(out).to eq("WIN")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -232,7 +232,7 @@ RSpec.describe "bundle install with git sources" do
 | 
			
		|||
      G
 | 
			
		||||
      expect(err).to be_empty
 | 
			
		||||
 | 
			
		||||
      run! <<-RUBY
 | 
			
		||||
      run <<-RUBY
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts "WIN" if defined?(FOO)
 | 
			
		||||
      RUBY
 | 
			
		||||
| 
						 | 
				
			
			@ -266,7 +266,7 @@ RSpec.describe "bundle install with git sources" do
 | 
			
		|||
      G
 | 
			
		||||
      expect(err).to be_empty
 | 
			
		||||
 | 
			
		||||
      run! <<-RUBY
 | 
			
		||||
      run <<-RUBY
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts "WIN" if defined?(FOO)
 | 
			
		||||
      RUBY
 | 
			
		||||
| 
						 | 
				
			
			@ -453,7 +453,7 @@ RSpec.describe "bundle install with git sources" do
 | 
			
		|||
 | 
			
		||||
      bundle %(config set local.rack #{lib_path("local-rack")})
 | 
			
		||||
      bundle :install
 | 
			
		||||
      run! "require 'rack'"
 | 
			
		||||
      run "require 'rack'"
 | 
			
		||||
      expect(out).to eq("LOCAL")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1135,7 +1135,7 @@ RSpec.describe "bundle install with git sources" do
 | 
			
		|||
      R
 | 
			
		||||
      expect(out).to eq("YES")
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        puts $:.grep(/ext/)
 | 
			
		||||
      R
 | 
			
		||||
      expect(out).to include(Pathname.glob(default_bundle_path("bundler/gems/extensions/**/foo-1.0-*")).first.to_s)
 | 
			
		||||
| 
						 | 
				
			
			@ -1223,7 +1223,7 @@ In Gemfile:
 | 
			
		|||
        gem "foo", :git => "#{lib_path("foo-1.0")}"
 | 
			
		||||
      G
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -1236,7 +1236,7 @@ In Gemfile:
 | 
			
		|||
        gem "foo", :git => "#{lib_path("foo-1.0")}"
 | 
			
		||||
      G
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -1265,7 +1265,7 @@ In Gemfile:
 | 
			
		|||
        gem "foo", :git => "#{lib_path("foo-1.0")}"
 | 
			
		||||
      G
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -1279,7 +1279,7 @@ In Gemfile:
 | 
			
		|||
        gem "foo", :git => "#{lib_path("foo-1.0")}"
 | 
			
		||||
      G
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -1307,7 +1307,7 @@ In Gemfile:
 | 
			
		|||
        gem "foo", :git => "#{lib_path("foo-1.0")}"
 | 
			
		||||
      G
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -1323,7 +1323,7 @@ In Gemfile:
 | 
			
		|||
        gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "branch2"
 | 
			
		||||
      G
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -1334,7 +1334,7 @@ In Gemfile:
 | 
			
		|||
      update_git("foo")
 | 
			
		||||
      bundle "update foo"
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'foo'
 | 
			
		||||
        puts FOO
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -122,7 +122,7 @@ RSpec.describe "bundle install with groups" do
 | 
			
		|||
      it "allows Bundler.setup for specific groups" do
 | 
			
		||||
        bundle "config --local without emo"
 | 
			
		||||
        bundle :install
 | 
			
		||||
        run!("require 'rack'; puts RACK", :default)
 | 
			
		||||
        run("require 'rack'; puts RACK", :default)
 | 
			
		||||
        expect(out).to eq("1.0.0")
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,7 +59,7 @@ RSpec.describe "compact index api" do
 | 
			
		|||
 | 
			
		||||
    # can't use `include_gems` here since the `require` will conflict on a
 | 
			
		||||
    # case-insensitive FS
 | 
			
		||||
    run! "Bundler.require; puts Gem.loaded_specs.values_at('rack', 'Rack').map(&:full_name)"
 | 
			
		||||
    run "Bundler.require; puts Gem.loaded_specs.values_at('rack', 'Rack').map(&:full_name)"
 | 
			
		||||
    expect(out).to eq("rack-1.0\nRack-0.1")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -83,7 +83,7 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
 | 
			
		|||
 | 
			
		||||
    expect(err).to_not include("warning: conflicting chdir during another chdir block")
 | 
			
		||||
 | 
			
		||||
    run! "Bundler.require; puts CExtension.new.its_true"
 | 
			
		||||
    run "Bundler.require; puts CExtension.new.its_true"
 | 
			
		||||
    expect(out).to eq("true")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -135,7 +135,7 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
 | 
			
		|||
      gem "c_extension_two", :git => #{lib_path("gems").to_s.dump}
 | 
			
		||||
    G
 | 
			
		||||
 | 
			
		||||
    run! "Bundler.require; puts CExtension_one.new.value; puts CExtension_two.new.value"
 | 
			
		||||
    run "Bundler.require; puts CExtension_one.new.value; puts CExtension_two.new.value"
 | 
			
		||||
    expect(out).to eq("one\ntwo")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -174,7 +174,7 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
 | 
			
		|||
      gem "c_extension", :git => #{lib_path("c_extension-1.0").to_s.dump}
 | 
			
		||||
    G
 | 
			
		||||
 | 
			
		||||
    run! "Bundler.require; puts CExtension.new.its_true"
 | 
			
		||||
    run "Bundler.require; puts CExtension.new.its_true"
 | 
			
		||||
    expect(out).to eq("true")
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -209,7 +209,7 @@ RSpec.describe "global gem caching" do
 | 
			
		|||
      cached_extensions = Pathname.glob(home(".bundle", "cache", "extensions", "*", "*", "*", "*", "*")).sort
 | 
			
		||||
      expect(cached_extensions).to eq [gem_binary_cache, git_binary_cache].sort
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'very_simple_binary_c'; puts ::VERY_SIMPLE_BINARY_IN_C
 | 
			
		||||
        require 'very_simple_git_binary_c'; puts ::VERY_SIMPLE_GIT_BINARY_IN_C
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			@ -225,7 +225,7 @@ RSpec.describe "global gem caching" do
 | 
			
		|||
 | 
			
		||||
      expect(Dir[home(".bundle", "cache", "extensions", "**", "*binary_c*")]).to all(end_with(".rb"))
 | 
			
		||||
 | 
			
		||||
      run! <<-R
 | 
			
		||||
      run <<-R
 | 
			
		||||
        require 'very_simple_binary_c'
 | 
			
		||||
        require 'very_simple_git_binary_c'
 | 
			
		||||
      R
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -375,7 +375,7 @@ RSpec.describe "Bundler.require" do
 | 
			
		|||
      gem "rack"
 | 
			
		||||
    G
 | 
			
		||||
 | 
			
		||||
    run! <<-R
 | 
			
		||||
    run <<-R
 | 
			
		||||
      path = File.join(Gem.dir, "specifications", "rack-1.0.0.gemspec")
 | 
			
		||||
      contents = File.read(path)
 | 
			
		||||
      contents = contents.lines.to_a.insert(-2, "\n  raise 'broken gemspec'\n").join
 | 
			
		||||
| 
						 | 
				
			
			@ -384,7 +384,7 @@ RSpec.describe "Bundler.require" do
 | 
			
		|||
      end
 | 
			
		||||
    R
 | 
			
		||||
 | 
			
		||||
    run! <<-R
 | 
			
		||||
    run <<-R
 | 
			
		||||
      Bundler.require
 | 
			
		||||
      puts "WIN"
 | 
			
		||||
    R
 | 
			
		||||
| 
						 | 
				
			
			@ -399,7 +399,7 @@ RSpec.describe "Bundler.require" do
 | 
			
		|||
      gem "foo", :git => "#{lib_path("foo-1.0")}"
 | 
			
		||||
    G
 | 
			
		||||
 | 
			
		||||
    run! <<-R
 | 
			
		||||
    run <<-R
 | 
			
		||||
      path = Gem.loaded_specs["foo"].loaded_from
 | 
			
		||||
      contents = File.read(path)
 | 
			
		||||
      contents = contents.lines.to_a.insert(-2, "\n  raise 'broken gemspec'\n").join
 | 
			
		||||
| 
						 | 
				
			
			@ -408,7 +408,7 @@ RSpec.describe "Bundler.require" do
 | 
			
		|||
      end
 | 
			
		||||
    R
 | 
			
		||||
 | 
			
		||||
    run! <<-R
 | 
			
		||||
    run <<-R
 | 
			
		||||
      Bundler.require
 | 
			
		||||
      puts "WIN"
 | 
			
		||||
    R
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -670,7 +670,7 @@ RSpec.describe "Bundler.setup" do
 | 
			
		|||
      gem "rack"
 | 
			
		||||
    G
 | 
			
		||||
 | 
			
		||||
    run! <<-R
 | 
			
		||||
    run <<-R
 | 
			
		||||
      File.open(File.join(Gem.dir, "specifications", "broken.gemspec"), "w") do |f|
 | 
			
		||||
        f.write <<-RUBY
 | 
			
		||||
# -*- encoding: utf-8 -*-
 | 
			
		||||
| 
						 | 
				
			
			@ -685,7 +685,7 @@ end
 | 
			
		|||
      end
 | 
			
		||||
    R
 | 
			
		||||
 | 
			
		||||
    run! <<-R
 | 
			
		||||
    run <<-R
 | 
			
		||||
      puts "WIN"
 | 
			
		||||
    R
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -722,7 +722,7 @@ end
 | 
			
		|||
          gem "with_man"
 | 
			
		||||
        G
 | 
			
		||||
 | 
			
		||||
        run! "puts ENV['MANPATH']"
 | 
			
		||||
        run "puts ENV['MANPATH']"
 | 
			
		||||
        expect(out).to eq("#{default_bundle_path("gems/with_man-1.0/man")}#{File::PATH_SEPARATOR}/foo")
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			@ -736,7 +736,7 @@ end
 | 
			
		|||
          gem "with_man"
 | 
			
		||||
        G
 | 
			
		||||
 | 
			
		||||
        run! "puts ENV['MANPATH']"
 | 
			
		||||
        run "puts ENV['MANPATH']"
 | 
			
		||||
        expect(out).to eq(default_bundle_path("gems/with_man-1.0/man").to_s)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -165,7 +165,7 @@ RSpec.describe "bundle update" do
 | 
			
		|||
          end
 | 
			
		||||
        G
 | 
			
		||||
 | 
			
		||||
        run! "require 'submodule'"
 | 
			
		||||
        run "require 'submodule'"
 | 
			
		||||
        expect(out).to eq("GIT")
 | 
			
		||||
 | 
			
		||||
        install_gemfile <<-G
 | 
			
		||||
| 
						 | 
				
			
			@ -175,7 +175,7 @@ RSpec.describe "bundle update" do
 | 
			
		|||
          end
 | 
			
		||||
        G
 | 
			
		||||
 | 
			
		||||
        run! "require 'submodule'"
 | 
			
		||||
        run "require 'submodule'"
 | 
			
		||||
        expect(out).to eq("GEM")
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue