diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-05-20 17:15:15 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-05-20 17:32:19 +0900 |
commit | aeea88174d88264469b406003765c7efdcd53edf (patch) | |
tree | a4d9de6d1a0027f5b9c2f2050bca2586b87596bb /test/rubygems | |
parent | bd8df25cdc8e0e94cbc2eacc492a764e6b90833c (diff) | |
download | ruby-aeea88174d88264469b406003765c7efdcd53edf.tar.gz |
Merge RubyGems and Bundler HEAD
https://github.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/helper.rb | 4 | ||||
-rw-r--r-- | test/rubygems/package/tar_test_case.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem.rb | 4 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_contents_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_install_command.rb | 4 | ||||
-rw-r--r-- | test/rubygems/test_gem_config_file.rb | 6 | ||||
-rw-r--r-- | test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb | 4 | ||||
-rw-r--r-- | test/rubygems/test_gem_gemcutter_utilities.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_package.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 30 | ||||
-rw-r--r-- | test/rubygems/test_gem_request_set_lockfile_parser.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_installer_set.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 22 | ||||
-rw-r--r-- | test/rubygems/test_require.rb | 20 | ||||
-rw-r--r-- | test/rubygems/test_rubygems.rb | 8 |
16 files changed, 58 insertions, 58 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 4460df8319..c03ce7e6c6 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -618,7 +618,7 @@ class Gem::TestCase < Test::Unit::TestCase gem = File.join(@tempdir, File.basename(gem)).tap(&Gem::UNTAINT) end - Gem::Installer.at(gem, options.merge({:wrappers => true})).install + Gem::Installer.at(gem, options.merge({ :wrappers => true })).install end ## @@ -1294,7 +1294,7 @@ Also, a list: end def rubygems_path - $LOAD_PATH.find{|p| p == File.dirname($LOADED_FEATURES.find{|f| f.end_with?("/rubygems.rb") }) } + $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) } end def with_clean_path_to_ruby diff --git a/test/rubygems/package/tar_test_case.rb b/test/rubygems/package/tar_test_case.rb index 99f503a23f..4517f40730 100644 --- a/test/rubygems/package/tar_test_case.rb +++ b/test/rubygems/package/tar_test_case.rb @@ -67,7 +67,7 @@ class Gem::Package::TarTestCase < Gem::TestCase end def calc_checksum(header) - sum = header.unpack("C*").inject{|s,a| s + a } + sum = header.unpack("C*").inject {|s,a| s + a } SP(Z(to_oct(sum, 6))) end diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 0ff8b4a1db..4d9644d5c9 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1061,7 +1061,7 @@ class TestGem < Gem::TestCase Gem.refresh - Gem::Specification.each{|spec| assert spec.activated? if spec == s } + Gem::Specification.each {|spec| assert spec.activated? if spec == s } Gem.loaded_specs.delete(s) Gem.refresh @@ -1430,7 +1430,7 @@ class TestGem < Gem::TestCase a = util_spec "a", "1" b = util_spec "b", "1", "c" => nil c = util_spec "c", "2" - d = util_spec "d", "1", {'e' => '= 1'}, "lib/d#{$$}.rb" + d = util_spec "d", "1", { 'e' => '= 1' }, "lib/d#{$$}.rb" e = util_spec "e", "1" install_specs a, c, b, e, d diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb index d79174717b..cf93d81e7e 100644 --- a/test/rubygems/test_gem_commands_contents_command.rb +++ b/test/rubygems/test_gem_commands_contents_command.rb @@ -239,7 +239,7 @@ lib/foo.rb [RbConfig::CONFIG['bindir'], 'default_command'], [RbConfig::CONFIG['rubylibdir'], 'default/gem.rb'], [RbConfig::CONFIG['archdir'], 'default_gem.so'], - ].sort.map{|a|File.join a }.join "\n" + ].sort.map {|a|File.join a }.join "\n" assert_equal expected, @ui.output.chomp assert_equal "", @ui.error diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb index 47a97dae4b..6127fcc124 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -521,7 +521,7 @@ ERROR: Possible alternatives: non_existent_with_hint end def test_execute_required_ruby_version - next_ruby = Gem.ruby_version.segments.map.with_index{|n, i| i == 1 ? n + 1 : n }.join(".") + next_ruby = Gem.ruby_version.segments.map.with_index {|n, i| i == 1 ? n + 1 : n }.join(".") local = Gem::Platform.local spec_fetcher do |fetcher| @@ -610,7 +610,7 @@ ERROR: Possible alternatives: non_existent_with_hint end def test_execute_required_ruby_version_specific_prerelease_not_met - next_ruby_pre = Gem.ruby_version.segments.map.with_index{|n, i| i == 1 ? n + 1 : n }.join(".") + ".a" + next_ruby_pre = Gem.ruby_version.segments.map.with_index {|n, i| i == 1 ? n + 1 : n }.join(".") + ".a" spec_fetcher do |fetcher| fetcher.gem 'a', '1.0' do |s| diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index 32375e6936..3e09079df8 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -190,7 +190,7 @@ class TestGemConfigFile < Gem::TestCase util_config_file - assert_equal({:rubygems => '701229f217cdf23b1344c7b4b54ca97'}, + assert_equal({ :rubygems => '701229f217cdf23b1344c7b4b54ca97' }, @cfg.api_keys) end @@ -317,8 +317,8 @@ if you believe they were disclosed to a third party. util_config_file - assert_equal({:rubygems => '701229f217cdf23b1344c7b4b54ca97', - :other => 'a5fdbb6ba150cbb83aad2bb2fede64c'}, @cfg.api_keys) + assert_equal({ :rubygems => '701229f217cdf23b1344c7b4b54ca97', + :other => 'a5fdbb6ba150cbb83aad2bb2fede64c' }, @cfg.api_keys) end def test_load_api_keys_bad_permission diff --git a/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb b/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb index 63ac2e5ce6..4d2f8488a4 100644 --- a/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +++ b/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb @@ -15,7 +15,7 @@ gemspec = File.expand_path('custom_name.gemspec', __dir__) Dir.mktmpdir("custom_name") do |dir| built_gem = File.expand_path(File.join(dir, "custom_name.gem")) - system(*gem, "build", gemspec, "--output", built_gem) - system(*gem, "install", "--verbose", "--local", built_gem, *ARGV) + system *gem, "build", gemspec, "--output", built_gem + system *gem, "install", "--verbose", "--local", built_gem, *ARGV system %q(ruby -rcustom_name -e "puts 'Result: ' + CustomName.say_hello") end diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb index 667aba4701..9bfc22a202 100644 --- a/test/rubygems/test_gem_gemcutter_utilities.rb +++ b/test/rubygems/test_gem_gemcutter_utilities.rb @@ -254,7 +254,7 @@ class TestGemGemcutterUtilities < Gem::TestCase end def test_verify_api_key - keys = {:other => 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'} + keys = { :other => 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903' } File.open Gem.configuration.credentials_path, 'w' do |f| f.write keys.to_yaml end diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb index 9172b7eef5..34660bdccd 100644 --- a/test/rubygems/test_gem_package.rb +++ b/test/rubygems/test_gem_package.rb @@ -218,7 +218,7 @@ class TestGemPackage < Gem::Package::TarTestCase end assert_equal %w[lib/code.rb], files - assert_equal [{'lib/code_sym.rb' => 'code.rb'}, {'lib/code_sym2.rb' => '../lib/code.rb'}], symlinks + assert_equal [{ 'lib/code_sym.rb' => 'code.rb' }, { 'lib/code_sym2.rb' => '../lib/code.rb' }], symlinks end def test_build diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 3ce9be7c90..fa82a117a1 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -705,7 +705,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_http_with_additional_headers ENV["http_proxy"] = @proxy_uri ENV["no_proxy"] = URI::parse(@server_uri).host - fetcher = Gem::RemoteFetcher.new nil, nil, {"X-Captain" => "murphy"} + fetcher = Gem::RemoteFetcher.new nil, nil, { "X-Captain" => "murphy" } @fetcher = fetcher assert_equal "murphy", fetcher.fetch_path(@server_uri) end @@ -745,7 +745,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_config_creds Gem.configuration[:s3_source] = { - 'my-bucket' => {:id => 'testuser', :secret => 'testpass'}, + 'my-bucket' => { :id => 'testuser', :secret => 'testpass' }, } url = 's3://my-bucket/gems/specs.4.8.gz' Time.stub :now, Time.at(1561353581) do @@ -757,7 +757,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_config_creds_with_region Gem.configuration[:s3_source] = { - 'my-bucket' => {:id => 'testuser', :secret => 'testpass', :region => 'us-west-2'}, + 'my-bucket' => { :id => 'testuser', :secret => 'testpass', :region => 'us-west-2' }, } url = 's3://my-bucket/gems/specs.4.8.gz' Time.stub :now, Time.at(1561353581) do @@ -769,7 +769,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_config_creds_with_token Gem.configuration[:s3_source] = { - 'my-bucket' => {:id => 'testuser', :secret => 'testpass', :security_token => 'testtoken'}, + 'my-bucket' => { :id => 'testuser', :secret => 'testpass', :security_token => 'testtoken' }, } url = 's3://my-bucket/gems/specs.4.8.gz' Time.stub :now, Time.at(1561353581) do @@ -784,7 +784,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== ENV['AWS_SECRET_ACCESS_KEY'] = 'testpass' ENV['AWS_SESSION_TOKEN'] = nil Gem.configuration[:s3_source] = { - 'my-bucket' => {:provider => 'env'}, + 'my-bucket' => { :provider => 'env' }, } url = 's3://my-bucket/gems/specs.4.8.gz' Time.stub :now, Time.at(1561353581) do @@ -800,7 +800,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== ENV['AWS_SECRET_ACCESS_KEY'] = 'testpass' ENV['AWS_SESSION_TOKEN'] = nil Gem.configuration[:s3_source] = { - 'my-bucket' => {:provider => 'env', :region => 'us-west-2'}, + 'my-bucket' => { :provider => 'env', :region => 'us-west-2' }, } url = 's3://my-bucket/gems/specs.4.8.gz' Time.stub :now, Time.at(1561353581) do @@ -816,7 +816,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== ENV['AWS_SECRET_ACCESS_KEY'] = 'testpass' ENV['AWS_SESSION_TOKEN'] = 'testtoken' Gem.configuration[:s3_source] = { - 'my-bucket' => {:provider => 'env'}, + 'my-bucket' => { :provider => 'env' }, } url = 's3://my-bucket/gems/specs.4.8.gz' Time.stub :now, Time.at(1561353581) do @@ -836,7 +836,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_instance_profile_creds Gem.configuration[:s3_source] = { - 'my-bucket' => {:provider => 'instance_profile'}, + 'my-bucket' => { :provider => 'instance_profile' }, } url = 's3://my-bucket/gems/specs.4.8.gz' @@ -850,7 +850,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_instance_profile_creds_with_region Gem.configuration[:s3_source] = { - 'my-bucket' => {:provider => 'instance_profile', :region => 'us-west-2'}, + 'my-bucket' => { :provider => 'instance_profile', :region => 'us-west-2' }, } url = 's3://my-bucket/gems/specs.4.8.gz' @@ -864,7 +864,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_instance_profile_creds_with_token Gem.configuration[:s3_source] = { - 'my-bucket' => {:provider => 'instance_profile'}, + 'my-bucket' => { :provider => 'instance_profile' }, } url = 's3://my-bucket/gems/specs.4.8.gz' @@ -894,7 +894,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_fetch_s3_no_host Gem.configuration[:s3_source] = { - 'my-bucket' => {:id => 'testuser', :secret => 'testpass'}, + 'my-bucket' => { :id => 'testuser', :secret => 'testpass' }, } url = 's3://other-bucket/gems/specs.4.8.gz' @@ -904,7 +904,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== end def test_fetch_s3_no_id - Gem.configuration[:s3_source] = { 'my-bucket' => {:secret => 'testpass'} } + Gem.configuration[:s3_source] = { 'my-bucket' => { :secret => 'testpass' } } url = 's3://my-bucket/gems/specs.4.8.gz' refute_fetch_s3 url, 's3_source for my-bucket missing id or secret' @@ -913,7 +913,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== end def test_fetch_s3_no_secret - Gem.configuration[:s3_source] = { 'my-bucket' => {:id => 'testuser'} } + Gem.configuration[:s3_source] = { 'my-bucket' => { :id => 'testuser' } } url = 's3://my-bucket/gems/specs.4.8.gz' refute_fetch_s3 url, 's3_source for my-bucket missing id or secret' @@ -973,7 +973,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_ssl_client_cert_auth_connection ssl_server = start_ssl_server({ :SSLVerifyClient => - OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT}) + OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT }) temp_ca_cert = File.join(__dir__, 'ca_cert.pem') temp_client_cert = File.join(__dir__, 'client.pem') @@ -988,7 +988,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== def test_do_not_allow_invalid_client_cert_auth_connection ssl_server = start_ssl_server({ :SSLVerifyClient => - OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT}) + OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT }) temp_ca_cert = File.join(__dir__, 'ca_cert.pem') temp_client_cert = File.join(__dir__, 'invalid_client.pem') diff --git a/test/rubygems/test_gem_request_set_lockfile_parser.rb b/test/rubygems/test_gem_request_set_lockfile_parser.rb index 4007c3a69c..775085964e 100644 --- a/test/rubygems/test_gem_request_set_lockfile_parser.rb +++ b/test/rubygems/test_gem_request_set_lockfile_parser.rb @@ -248,7 +248,7 @@ DEPENDENCIES assert_equal %w[a-2], lockfile_set.specs.map {|s| s.full_name } assert_equal %w[https://gems.example/ https://other.example/], - lockfile_set.specs.flat_map {|s| s.sources.map{|src| src.uri.to_s } } + lockfile_set.specs.flat_map {|s| s.sources.map {|src| src.uri.to_s } } end def test_parse_GIT diff --git a/test/rubygems/test_gem_resolver.rb b/test/rubygems/test_gem_resolver.rb index ea9f9049ce..ab0cdaddb9 100644 --- a/test/rubygems/test_gem_resolver.rb +++ b/test/rubygems/test_gem_resolver.rb @@ -191,7 +191,7 @@ class TestGemResolver < Gem::TestCase # With the following gems already installed: # a-1, b-1, c-1, e-1 - res.skip_gems = {'a' => [a1_spec], 'b' => [b1_spec], 'c' => [c1_spec], 'e' => [e1_spec]} + res.skip_gems = { 'a' => [a1_spec], 'b' => [b1_spec], 'c' => [c1_spec], 'e' => [e1_spec] } # Make sure the following gems end up getting used/installed/upgraded: # a-2 (upgraded) diff --git a/test/rubygems/test_gem_resolver_installer_set.rb b/test/rubygems/test_gem_resolver_installer_set.rb index 928a16b9d3..7a6d17f2b0 100644 --- a/test/rubygems/test_gem_resolver_installer_set.rb +++ b/test/rubygems/test_gem_resolver_installer_set.rb @@ -210,7 +210,7 @@ class TestGemResolverInstallerSet < Gem::TestCase def (set.remote_set).prefetch(_) raise "called" end - assert_raise(RuntimeError){ set.prefetch(nil) } + assert_raise(RuntimeError) { set.prefetch(nil) } set = Gem::Resolver::InstallerSet.new :local def (set.remote_set).prefetch(_) diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 55dd7f0ff2..103d886537 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -158,7 +158,7 @@ end util_spec "pkg#{pkgi}", pkg_version.to_s, deps end end - base = util_spec "pkg_base", "1", {"pkg0" => ">= 0"} + base = util_spec "pkg_base", "1", { "pkg0" => ">= 0" } Gem::Specification.reset install_specs(*packages.flatten.reverse) @@ -305,10 +305,10 @@ end def test_require_should_not_conflict base = util_spec "0", "1", "A" => ">= 1" - a1 = util_spec "A", "1", {"c" => ">= 2", "b" => "> 0"}, "lib/a.rb" - a2 = util_spec "A", "2", {"c" => ">= 2", "b" => "> 0"}, "lib/a.rb" - b1 = util_spec "b", "1", {"c" => "= 1"}, "lib/d#{$$}.rb" - b2 = util_spec "b", "2", {"c" => "= 2"}, "lib/d#{$$}.rb" + a1 = util_spec "A", "1", { "c" => ">= 2", "b" => "> 0" }, "lib/a.rb" + a2 = util_spec "A", "2", { "c" => ">= 2", "b" => "> 0" }, "lib/a.rb" + b1 = util_spec "b", "1", { "c" => "= 1" }, "lib/d#{$$}.rb" + b2 = util_spec "b", "2", { "c" => "= 2" }, "lib/d#{$$}.rb" c1 = util_spec "c", "1", {}, "lib/c.rb" c2 = util_spec "c", "2", {}, "lib/c.rb" c3 = util_spec "c", "3", {}, "lib/c.rb" @@ -992,8 +992,8 @@ dependencies: [] dir_standard_specs = File.join Gem.dir, 'specifications' - save_gemspec('a-1', '1', dir_standard_specs){|s| s.name = 'a' } - save_gemspec('b-1', '1', dir_standard_specs){|s| s.name = 'b' } + save_gemspec('a-1', '1', dir_standard_specs) {|s| s.name = 'a' } + save_gemspec('b-1', '1', dir_standard_specs) {|s| s.name = 'b' } assert_equal ['a-1'], Gem::Specification.stubs_for('a').map {|s| s.full_name } assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length @@ -1013,7 +1013,7 @@ dependencies: [] 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' } + 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 @@ -1060,9 +1060,9 @@ dependencies: [] def test_self_stubs_returns_only_specified_named_specs dir_standard_specs = File.join Gem.dir, 'specifications' - save_gemspec('a-1', '1', dir_standard_specs){|s| s.name = 'a' } - save_gemspec('a-2', '2', dir_standard_specs){|s| s.name = 'a' } - save_gemspec('a-a', '3', dir_standard_specs){|s| s.name = 'a-a' } + save_gemspec('a-1', '1', dir_standard_specs) {|s| s.name = 'a' } + save_gemspec('a-2', '2', dir_standard_specs) {|s| s.name = 'a' } + save_gemspec('a-a', '3', dir_standard_specs) {|s| s.name = 'a-a' } assert_equal ['a-1', 'a-2'], Gem::Specification.stubs_for('a').map(&:full_name).sort end diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb index 8857ceef25..2b63bc600a 100644 --- a/test/rubygems/test_require.rb +++ b/test/rubygems/test_require.rb @@ -63,8 +63,8 @@ class TestGemRequire < Gem::TestCase # Providing -I on the commandline should always beat gems def test_dash_i_beats_gems - a1 = util_spec "a", "1", {"b" => "= 1"}, "lib/test_gem_require_a.rb" - b1 = util_spec "b", "1", {"c" => "> 0"}, "lib/b/c.rb" + a1 = util_spec "a", "1", { "b" => "= 1" }, "lib/test_gem_require_a.rb" + b1 = util_spec "b", "1", { "c" => "> 0" }, "lib/b/c.rb" c1 = util_spec "c", "1", nil, "lib/c/c.rb" c2 = util_spec "c", "2", nil, "lib/c/c.rb" @@ -102,8 +102,8 @@ class TestGemRequire < Gem::TestCase # Providing -I on the commandline should always beat gems def test_dash_i_beats_default_gems - a1 = new_default_spec "a", "1", {"b" => "= 1"}, "test_gem_require_a.rb" - b1 = new_default_spec "b", "1", {"c" => "> 0"}, "b/c.rb" + a1 = new_default_spec "a", "1", { "b" => "= 1" }, "test_gem_require_a.rb" + b1 = new_default_spec "b", "1", { "c" => "> 0" }, "b/c.rb" c1 = new_default_spec "c", "1", nil, "c/c.rb" c2 = new_default_spec "c", "2", nil, "c/c.rb" @@ -152,8 +152,8 @@ class TestGemRequire < Gem::TestCase install_specs a1, b1 - t1 = create_sync_thread{ assert_require "a#{$$}" } - t2 = create_sync_thread{ assert_require "b#{$$}" } + t1 = create_sync_thread { assert_require "a#{$$}" } + t2 = create_sync_thread { assert_require "b#{$$}" } # wait until both files are waiting on the exit latch FILE_ENTERED_LATCH.await @@ -169,7 +169,7 @@ class TestGemRequire < Gem::TestCase end def test_require_is_not_lazy_with_exact_req - a1 = util_spec "a", "1", {"b" => "= 1"}, "lib/test_gem_require_a.rb" + a1 = util_spec "a", "1", { "b" => "= 1" }, "lib/test_gem_require_a.rb" b1 = util_spec "b", "1", nil, "lib/b/c.rb" b2 = util_spec "b", "2", nil, "lib/b/c.rb" @@ -184,7 +184,7 @@ class TestGemRequire < Gem::TestCase end def test_require_is_lazy_with_inexact_req - a1 = util_spec "a", "1", {"b" => ">= 1"}, "lib/test_gem_require_a.rb" + a1 = util_spec "a", "1", { "b" => ">= 1" }, "lib/test_gem_require_a.rb" b1 = util_spec "b", "1", nil, "lib/b/c.rb" b2 = util_spec "b", "2", nil, "lib/b/c.rb" @@ -199,7 +199,7 @@ class TestGemRequire < Gem::TestCase end def test_require_is_not_lazy_with_one_possible - a1 = util_spec "a", "1", {"b" => ">= 1"}, "lib/test_gem_require_a.rb" + a1 = util_spec "a", "1", { "b" => ">= 1" }, "lib/test_gem_require_a.rb" b1 = util_spec "b", "1", nil, "lib/b/c.rb" install_specs b1, a1 @@ -243,7 +243,7 @@ class TestGemRequire < Gem::TestCase require 'benchmark' # the stdlib - a1 = util_spec "a", "1", {"b" => ">= 1"}, "lib/test_gem_require_a.rb" + a1 = util_spec "a", "1", { "b" => ">= 1" }, "lib/test_gem_require_a.rb" b1 = util_spec "b", "1", nil, "lib/benchmark.rb" b2 = util_spec "b", "2", nil, "lib/benchmark.rb" diff --git a/test/rubygems/test_rubygems.rb b/test/rubygems/test_rubygems.rb index 26c5f1e0fd..739a9985b0 100644 --- a/test/rubygems/test_rubygems.rb +++ b/test/rubygems/test_rubygems.rb @@ -2,7 +2,7 @@ require_relative 'helper' class GemTest < Gem::TestCase def test_rubygems_normal_behaviour - _ = Gem::Util.popen(*ruby_with_rubygems_in_load_path, '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip + _ = Gem::Util.popen(*ruby_with_rubygems_in_load_path, '-e', "'require \"rubygems\"'", { :err => [:child, :out] }).strip assert $?.success? end @@ -13,7 +13,7 @@ class GemTest < Gem::TestCase intentionally_not_implemented_method RUBY - output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip + output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "'require \"rubygems\"'", { :err => [:child, :out] }).strip assert !$?.success? assert_includes output, "undefined local variable or method `intentionally_not_implemented_method'" assert_includes output, "Loading the rubygems/defaults/operating_system.rb file caused an error. " \ @@ -40,7 +40,7 @@ class GemTest < Gem::TestCase *ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "require \"rubygems\"; puts Gem::Specification.stubs.map(&:full_name)", - {:err => [:child, :out]} + { :err => [:child, :out] } ).strip begin assert_empty output @@ -66,6 +66,6 @@ class GemTest < Gem::TestCase end def ruby_with_rubygems_and_fake_operating_system_in_load_path(operating_system_path) - [Gem.ruby, "-I", operating_system_path, "-I" , $LOAD_PATH.find{|p| p == File.dirname($LOADED_FEATURES.find{|f| f.end_with?("/rubygems.rb") }) }] + [Gem.ruby, "-I", operating_system_path, "-I" , $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) }] end end |