diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-01-14 13:38:47 +0900 |
---|---|---|
committer | NARUSE, Yui <nurse@users.noreply.github.com> | 2021-01-14 16:44:42 +0900 |
commit | 29777cb32ad6417c3583a81b01127c93cd667e77 (patch) | |
tree | 14d9c552ecbd1e0c8c0e6910364bd796f4840cff /test | |
parent | 93dcf0828dc8e627e0c24497795d927911a9d993 (diff) |
Merge RubyGems-3.2.5
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem_commands_setup_command.rb | 9 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb index 66a6707eb8..29850c9074 100644 --- a/test/rubygems/test_gem_commands_setup_command.rb +++ b/test/rubygems/test_gem_commands_setup_command.rb @@ -24,6 +24,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase lib/rubygems/test_case.rb lib/rubygems/ssl_certs/rubygems.org/foo.pem bundler/exe/bundle + bundler/exe/bundler bundler/lib/bundler.rb bundler/lib/bundler/b.rb bundler/bin/bundler/man/bundle-b.1 @@ -41,7 +42,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase gemspec.name = "bundler" gemspec.version = BUNDLER_VERS gemspec.bindir = "exe" - gemspec.executables = ["bundle"] + gemspec.executables = ["bundle", "bundler"] File.open 'bundler/bundler.gemspec', 'w' do |io| io.puts gemspec.to_ruby @@ -135,6 +136,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase exec_line = out.shift until exec_line == "RubyGems installed the following executables:" assert_equal "\t#{default_gem_bin_path}", out.shift assert_equal "\t#{default_bundle_bin_path}", out.shift + assert_equal "\t#{default_bundler_bin_path}", out.shift end def test_env_shebang_flag @@ -152,6 +154,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " " assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_gem_bin_path) assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundle_bin_path) + assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundler_bin_path) assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_bin_path) end @@ -387,4 +390,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase def default_bundle_bin_path File.join @install_dir, 'bin', 'bundle' end + + def default_bundler_bin_path + File.join @install_dir, 'bin', 'bundler' + end end unless Gem.java_platform? diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 374d58d38f..763b62c22b 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -1161,6 +1161,14 @@ dependencies: [] Gem::Specification.class_variable_set(:@@stubs, nil) end + def test_self_stubs_for_no_lazy_loading_after_all_specs_setup + Gem::Specification.all = [util_spec('a', '1')] + + save_gemspec('b-1', '1', File.join(Gem.dir, 'specifications')){|s| s.name = 'b' } + + assert_equal [], Gem::Specification.stubs_for('b').map {|s| s.full_name } + end + def test_self_stubs_for_mult_platforms # gems for two different platforms are installed with --user-install # the correct one should be returned in the array |