diff options
Diffstat (limited to 'test/rubygems')
34 files changed, 239 insertions, 239 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 57e1f4f16f..aef00cd761 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -21,7 +21,7 @@ class TestGem < Gem::TestCase common_installer_setup ENV.delete 'RUBYGEMS_GEMDEPS' - @additional = %w[a b].map { |d| File.join @tempdir, d } + @additional = %w[a b].map {|d| File.join @tempdir, d } util_remove_interrupt_command end @@ -105,7 +105,7 @@ class TestGem < Gem::TestCase installed = Gem.install 'a', '= 1', :install_dir => gemhome2 - assert_equal %w[a-1], installed.map { |spec| spec.full_name } + assert_equal %w[a-1], installed.map {|spec| spec.full_name } assert_path_exists File.join(gemhome2, 'gems', 'a-1') end @@ -124,7 +124,7 @@ class TestGem < Gem::TestCase rescue StandardError Gem.install 'a', '= 1', :install_dir => gemhome2 end - assert_equal %w[a-1], installed.map { |spec| spec.full_name } + assert_equal %w[a-1], installed.map {|spec| spec.full_name } end def test_self_install_permissions @@ -208,7 +208,7 @@ class TestGem < Gem::TestCase end assert_equal(expected, result) ensure - File.chmod(0755, *Dir.glob(@gemhome + '/gems/**/').map {|path| path.tap(&Gem::UNTAINT)}) + File.chmod(0755, *Dir.glob(@gemhome + '/gems/**/').map {|path| path.tap(&Gem::UNTAINT) }) end def test_require_missing @@ -337,7 +337,7 @@ class TestGem < Gem::TestCase L end - File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') } + File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') } e = assert_raises Gem::GemNotFoundException do load Gem.activate_bin_path("bundler", "bundle", ">= 0.a") @@ -376,7 +376,7 @@ class TestGem < Gem::TestCase L end - File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') } + File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') } load Gem.activate_bin_path("bundler", "bundle", ">= 0.a") @@ -410,7 +410,7 @@ class TestGem < Gem::TestCase L end - File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') } + File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') } load Gem.activate_bin_path("bundler", "bundle", "= 1.17.3") @@ -1021,7 +1021,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 @@ -1163,7 +1163,7 @@ class TestGem < Gem::TestCase def test_self_post_build assert_equal 1, Gem.post_build_hooks.length - Gem.post_build { |installer| } + Gem.post_build {|installer| } assert_equal 2, Gem.post_build_hooks.length end @@ -1171,7 +1171,7 @@ class TestGem < Gem::TestCase def test_self_post_install assert_equal 1, Gem.post_install_hooks.length - Gem.post_install { |installer| } + Gem.post_install {|installer| } assert_equal 2, Gem.post_install_hooks.length end @@ -1179,7 +1179,7 @@ class TestGem < Gem::TestCase def test_self_done_installing assert_empty Gem.done_installing_hooks - Gem.done_installing { |gems| } + Gem.done_installing {|gems| } assert_equal 1, Gem.done_installing_hooks.length end @@ -1187,7 +1187,7 @@ class TestGem < Gem::TestCase def test_self_post_reset assert_empty Gem.post_reset_hooks - Gem.post_reset { } + Gem.post_reset {} assert_equal 1, Gem.post_reset_hooks.length end @@ -1195,7 +1195,7 @@ class TestGem < Gem::TestCase def test_self_post_uninstall assert_equal 1, Gem.post_uninstall_hooks.length - Gem.post_uninstall { |installer| } + Gem.post_uninstall {|installer| } assert_equal 2, Gem.post_uninstall_hooks.length end @@ -1203,7 +1203,7 @@ class TestGem < Gem::TestCase def test_self_pre_install assert_equal 1, Gem.pre_install_hooks.length - Gem.pre_install { |installer| } + Gem.pre_install {|installer| } assert_equal 2, Gem.pre_install_hooks.length end @@ -1211,7 +1211,7 @@ class TestGem < Gem::TestCase def test_self_pre_reset assert_empty Gem.pre_reset_hooks - Gem.pre_reset { } + Gem.pre_reset {} assert_equal 1, Gem.pre_reset_hooks.length end @@ -1219,7 +1219,7 @@ class TestGem < Gem::TestCase def test_self_pre_uninstall assert_equal 1, Gem.pre_uninstall_hooks.length - Gem.pre_uninstall { |installer| } + Gem.pre_uninstall {|installer| } assert_equal 2, Gem.pre_uninstall_hooks.length end @@ -1248,7 +1248,7 @@ class TestGem < Gem::TestCase install_specs b1, b2, b3 - specs1 = Gem::Specification.stubs.find_all { |s| s.name == 'b' } + specs1 = Gem::Specification.stubs.find_all {|s| s.name == 'b' } Gem::Specification.reset specs2 = Gem::Specification.stubs_for('b') assert_equal specs1.map(&:version), specs2.map(&:version) @@ -1397,7 +1397,7 @@ class TestGem < Gem::TestCase r.gem "b", "= 1" end - activated = Gem::Specification.map { |x| x.full_name } + activated = Gem::Specification.map {|x| x.full_name } assert_equal %w[a-1 b-1 c-2], activated.sort end @@ -1518,8 +1518,8 @@ class TestGem < Gem::TestCase def test_gem_path_ordering refute_equal Gem.dir, Gem.user_dir - write_file File.join(@tempdir, 'lib', "g.rb") { |fp| fp.puts "" } - write_file File.join(@tempdir, 'lib', 'm.rb') { |fp| fp.puts "" } + write_file File.join(@tempdir, 'lib', "g.rb") {|fp| fp.puts "" } + write_file File.join(@tempdir, 'lib', 'm.rb') {|fp| fp.puts "" } g = util_spec 'g', '1', nil, "lib/g.rb" m = util_spec 'm', '1', nil, "lib/m.rb" @@ -1574,8 +1574,8 @@ class TestGem < Gem::TestCase end def test_gem_path_ordering_short - write_file File.join(@tempdir, 'lib', "g.rb") { |fp| fp.puts "" } - write_file File.join(@tempdir, 'lib', 'm.rb') { |fp| fp.puts "" } + write_file File.join(@tempdir, 'lib', "g.rb") {|fp| fp.puts "" } + write_file File.join(@tempdir, 'lib', 'm.rb') {|fp| fp.puts "" } g = util_spec 'g', '1', nil, "lib/g.rb" m = util_spec 'm', '1', nil, "lib/m.rb" @@ -1632,7 +1632,7 @@ class TestGem < Gem::TestCase ENV['RUBYGEMS_GEMDEPS'] = "-" expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact - assert_equal expected_specs, Gem.use_gemdeps.sort_by { |s| s.name } + assert_equal expected_specs, Gem.use_gemdeps.sort_by {|s| s.name } end BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) } @@ -1765,7 +1765,7 @@ class TestGem < Gem::TestCase spec = util_spec 'a', 1 install_specs spec - spec = Gem::Specification.find { |s| s == spec } + spec = Gem::Specification.find {|s| s == spec } refute spec.activated? File.open gem_deps_file, 'w' do |io| @@ -1826,7 +1826,7 @@ class TestGem < Gem::TestCase spec = util_spec 'a', 1 install_specs spec - spec = Gem::Specification.find { |s| s == spec } + spec = Gem::Specification.find {|s| s == spec } refute spec.activated? @@ -1904,7 +1904,7 @@ You may need to `gem install -g` to install missing gems spec = util_spec 'a', 1 install_specs spec - spec = Gem::Specification.find { |s| s == spec } + spec = Gem::Specification.find {|s| s == spec } refute spec.activated? File.open 'x', 'w' do |io| diff --git a/test/rubygems/test_gem_available_set.rb b/test/rubygems/test_gem_available_set.rb index 64ee9a36a9..e48b5bbde4 100644 --- a/test/rubygems/test_gem_available_set.rb +++ b/test/rubygems/test_gem_available_set.rb @@ -37,12 +37,12 @@ class TestGemAvailableSet < Gem::TestCase dep = Gem::Resolver::DependencyRequest.new dep('a'), nil - assert_equal %w[a-1], set.find_all(dep).map { |spec| spec.full_name } + assert_equal %w[a-1], set.find_all(dep).map {|spec| spec.full_name } dep = Gem::Resolver::DependencyRequest.new dep('a', '>= 0.a'), nil assert_equal %w[a-1 a-1.a], - set.find_all(dep).map { |spec| spec.full_name }.sort + set.find_all(dep).map {|spec| spec.full_name }.sort end def test_match_platform @@ -123,7 +123,7 @@ class TestGemAvailableSet < Gem::TestCase set.add a2a, @source set.add a2, @source - g = set.sorted.map { |t| t.spec } + g = set.sorted.map {|t| t.spec } assert_equal [a3a, a2, a2a, a1, a1a], g end diff --git a/test/rubygems/test_gem_bundler_version_finder.rb b/test/rubygems/test_gem_bundler_version_finder.rb index bfd13727c9..7fbbcc4f8a 100644 --- a/test/rubygems/test_gem_bundler_version_finder.rb +++ b/test/rubygems/test_gem_bundler_version_finder.rb @@ -120,7 +120,7 @@ class TestGemBundlerVersionFinder < Gem::TestCase def test_filter versions = %w[1 1.0 1.0.1.1 2 2.a 2.0 2.1.1 3 3.a 3.0 3.1.1] - specs = versions.map { |v| util_spec("bundler", v) } + specs = versions.map {|v| util_spec("bundler", v) } assert_equal %w[1 1.0 1.0.1.1 2 2.a 2.0 2.1.1 3 3.a 3.0 3.1.1], util_filter_specs(specs).map(&:version).map(&:to_s) diff --git a/test/rubygems/test_gem_command.rb b/test/rubygems/test_gem_command.rb index 44ec324ab9..bb31d9c278 100644 --- a/test/rubygems/test_gem_command.rb +++ b/test/rubygems/test_gem_command.rb @@ -34,7 +34,7 @@ class TestGemCommand < Gem::TestCase def test_self_add_specific_extra_args added_args = %w[--all] - @cmd.add_option('--all') { |v,o| } + @cmd.add_option('--all') {|v,o| } Gem::Command.add_specific_extra_args @cmd_name, added_args diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb index fd1e66b915..d149f768ef 100644 --- a/test/rubygems/test_gem_commands_cert_command.rb +++ b/test/rubygems/test_gem_commands_cert_command.rb @@ -675,12 +675,12 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis ] assert_equal [PUBLIC_CERT.to_pem, ALTERNATE_CERT.to_pem], - @cmd.options[:add].map { |cert| cert.to_pem } + @cmd.options[:add].map {|cert| cert.to_pem } assert_equal %w[nobody example], @cmd.options[:remove] assert_equal %w[nobody@example other@example], - @cmd.options[:build].map { |name| name.to_s } + @cmd.options[:build].map {|name| name.to_s } assert_equal ['', 'example'], @cmd.options[:list] end diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb index d8f01ecbf0..00b49d04a7 100644 --- a/test/rubygems/test_gem_commands_contents_command.rb +++ b/test/rubygems/test_gem_commands_contents_command.rb @@ -240,7 +240,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 e86e9e24d5..7706eb41eb 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -43,7 +43,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_explicit_version_includes_prerelease @@ -65,7 +65,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase end end - assert_equal %w[a-2.a], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2.a], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_local @@ -91,7 +91,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "1 gem installed", @ui.output end @@ -182,7 +182,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a end end - assert_equal %w[a-2 b-2.a c-3], @cmd.installed_specs.map { |spec| spec.full_name }.sort + assert_equal %w[a-2 b-2.a c-3], @cmd.installed_specs.map {|spec| spec.full_name }.sort assert_match "3 gems installed", @ui.output end @@ -449,7 +449,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-1], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-1], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_prerelease_wins_over_previous_ver @@ -467,7 +467,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2.a], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2.a], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_with_version_specified_by_colon @@ -484,7 +484,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-1], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-1], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_prerelease_skipped_when_non_pre_available @@ -502,7 +502,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_rdoc @@ -627,7 +627,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "1 gem installed", @ui.output end @@ -647,7 +647,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "1 gem installed", @ui.output end @@ -688,7 +688,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-1], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-1], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "1 gem installed", @ui.output @@ -722,7 +722,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2 b-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2 b-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "2 gems installed", @ui.output end @@ -764,7 +764,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-1 b-1], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-1 b-1], @cmd.installed_specs.map {|spec| spec.full_name } end def test_execute_conservative @@ -790,7 +790,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[b-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[b-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_equal "", @ui.error assert_match "1 gem installed", @ui.output @@ -812,7 +812,7 @@ ERROR: Possible alternatives: non_existent_with_hint @cmd.install_gem 'a', '>= 0' - assert_equal %w[a-2], @cmd.installed_specs.map { |s| s.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|s| s.full_name } assert done_installing, 'documentation was not generated' end @@ -826,7 +826,7 @@ ERROR: Possible alternatives: non_existent_with_hint @cmd.install_gem 'a', '>= 0' - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } end def test_install_gem_ignore_dependencies_remote_platform_local @@ -843,7 +843,7 @@ ERROR: Possible alternatives: non_existent_with_hint @cmd.install_gem 'a', '>= 0' - assert_equal %W[a-3-#{local}], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %W[a-3-#{local}], @cmd.installed_specs.map {|spec| spec.full_name } end def test_install_gem_ignore_dependencies_specific_file @@ -857,7 +857,7 @@ ERROR: Possible alternatives: non_existent_with_hint @cmd.install_gem File.join(@tempdir, spec.file_name), nil - assert_equal %w[a-2], @cmd.installed_specs.map { |s| s.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|s| s.full_name } end def test_parses_requirement_from_gemname @@ -927,7 +927,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "1 gem installed", @ui.output @@ -954,7 +954,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "Using a (2)", @ui.output assert File.exist?("#{@gemdeps}.lock") @@ -978,7 +978,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "Using a (2)", @ui.output assert !File.exist?("#{@gemdeps}.lock") @@ -1003,7 +1003,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "Using a (1)", @ui.output end @@ -1025,7 +1025,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name } + assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name } assert_match "Installing a (2)", @ui.output end @@ -1048,7 +1048,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - names = @cmd.installed_specs.map { |spec| spec.full_name } + names = @cmd.installed_specs.map {|spec| spec.full_name } assert_equal %w[q-1.0 r-2.0], names @@ -1075,7 +1075,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - names = @cmd.installed_specs.map { |spec| spec.full_name } + names = @cmd.installed_specs.map {|spec| spec.full_name } assert_equal %w[r-2.0], names @@ -1102,7 +1102,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - names = @cmd.installed_specs.map { |spec| spec.full_name } + names = @cmd.installed_specs.map {|spec| spec.full_name } assert_equal %w[q-1.0 r-2.0], names @@ -1134,7 +1134,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - names = @cmd.installed_specs.map { |spec| spec.full_name } + names = @cmd.installed_specs.map {|spec| spec.full_name } assert_equal %w[q-1.0 r-2.0], names @@ -1169,7 +1169,7 @@ ERROR: Possible alternatives: non_existent_with_hint end end - names = @cmd.installed_specs.map { |spec| spec.full_name } + names = @cmd.installed_specs.map {|spec| spec.full_name } assert_equal %w[r-2.0], names diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb index 23b9bf5f15..d306abe295 100644 --- a/test/rubygems/test_gem_commands_query_command.rb +++ b/test/rubygems/test_gem_commands_query_command.rb @@ -644,7 +644,7 @@ a (2 universal-darwin, 1 ruby x86-linux) end def test_execute_show_default_gems - spec_fetcher { |fetcher| fetcher.spec 'a', 2 } + spec_fetcher {|fetcher| fetcher.spec 'a', 2 } a1 = new_default_spec 'a', 1 install_default_specs a1 diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb index 5994050f51..258dc494e4 100644 --- a/test/rubygems/test_gem_commands_signin_command.rb +++ b/test/rubygems/test_gem_commands_signin_command.rb @@ -66,7 +66,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase end def test_execute_with_valid_creds_set_for_default_host - util_capture {@cmd.execute} + util_capture { @cmd.execute } api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903' credentials = YAML.load_file Gem.configuration.credentials_path diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb index e7a72c1ef8..91d7a47189 100644 --- a/test/rubygems/test_gem_dependency_installer.rb +++ b/test/rubygems/test_gem_dependency_installer.rb @@ -157,7 +157,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }, + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }, 'sanity check' Dir.chdir @tempdir do @@ -165,7 +165,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'e' end - assert_equal %w[a-1 e-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 e-1], inst.installed_gems.map {|s| s.full_name } end def test_install_cache_dir @@ -182,7 +182,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name } assert File.exist? File.join(@gemhome, "cache", @a1.file_name) assert File.exist? File.join(@gemhome, "cache", @b1.file_name) @@ -207,7 +207,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'a', req("= 2") end - assert_equal %w[a-2], inst.installed_gems.map { |s| s.full_name }, + assert_equal %w[a-2], inst.installed_gems.map {|s| s.full_name }, 'sanity check' FileUtils.rm File.join(@tempdir, a2.file_name) @@ -218,7 +218,7 @@ class TestGemDependencyInstaller < Gem::TestCase end assert_equal %w[a-2 b-1], Gem::Specification.map(&:full_name) - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end # This asserts that if a gem's dependency is satisfied by an @@ -255,7 +255,7 @@ class TestGemDependencyInstaller < Gem::TestCase end assert_equal %w[a-2 b-1], Gem::Specification.map(&:full_name) - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_dependency @@ -278,7 +278,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name } assert done_installing_ran, 'post installs hook was not run' end @@ -300,7 +300,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[a-1 aa-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 aa-1 b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_dependency_development_deep @@ -322,7 +322,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'd' end - assert_equal %w[a-1 aa-1 b-1 c-1 d-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 aa-1 b-1 c-1 d-1], inst.installed_gems.map {|s| s.full_name } end def test_install_dependency_development_shallow @@ -344,7 +344,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'd' end - assert_equal %w[c-1 d-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[c-1 d-1], inst.installed_gems.map {|s| s.full_name } end def test_install_dependency_existing @@ -360,7 +360,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_dependency_existing_extension @@ -397,7 +397,7 @@ class TestGemDependencyInstaller < Gem::TestCase Dir.chdir pwd end - assert_equal %w[f-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[f-1], inst.installed_gems.map {|s| s.full_name } assert_path_exists e1.extension_dir end @@ -417,7 +417,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'f' end - assert_equal %w[f-2], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[f-2], inst.installed_gems.map {|s| s.full_name } end def test_install_local @@ -431,7 +431,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'a-1.gem' end - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name } end def test_install_local_prerelease @@ -445,7 +445,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'a-1.a.gem' end - assert_equal %w[a-1.a], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1.a], inst.installed_gems.map {|s| s.full_name } end def test_install_local_dependency @@ -461,7 +461,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b-1.gem' end - assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_local_dependency_installed @@ -479,7 +479,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b-1.gem' end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_local_subdir @@ -492,7 +492,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'gems/a-1.gem' end - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name } end def test_install_minimal_deps @@ -518,7 +518,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b', req('= 1') end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }, + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }, 'sanity check' Dir.chdir @tempdir do @@ -526,7 +526,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'e' end - assert_equal %w[a-1 e-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 e-1], inst.installed_gems.map {|s| s.full_name } end def test_install_no_document @@ -576,7 +576,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_build_args @@ -606,7 +606,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_install_dir @@ -627,7 +627,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name } assert File.exist?(File.join(gemhome2, 'specifications', @a1.spec_name)) assert File.exist?(File.join(gemhome2, 'cache', @a1.file_name)) @@ -651,7 +651,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name } a1, b1 = inst.installed_gems assert_equal a1.spec_file, a1.loaded_from @@ -675,7 +675,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_domain_local @@ -694,7 +694,7 @@ class TestGemDependencyInstaller < Gem::TestCase assert_equal expected, e.message end - assert_equal [], inst.installed_gems.map { |s| s.full_name } + assert_equal [], inst.installed_gems.map {|s| s.full_name } end def test_install_domain_remote @@ -710,7 +710,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst = Gem::DependencyInstaller.new :domain => :remote inst.install 'a' - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name } end def test_install_dual_repository @@ -727,7 +727,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'a' end - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }, + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }, 'sanity check' ENV['GEM_HOME'] = @gemhome @@ -739,7 +739,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'b' end - assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name } end def test_install_reinstall @@ -774,7 +774,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'a' end - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name } end def test_install_remote_dep @@ -794,7 +794,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install dep end - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name } end def test_install_remote_platform_newer @@ -827,7 +827,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst = Gem::DependencyInstaller.new :domain => :remote inst.install 'a' - assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name } end def test_install_platform_is_ignored_when_a_file_is_specified @@ -838,17 +838,17 @@ class TestGemDependencyInstaller < Gem::TestCase inst = Gem::DependencyInstaller.new :domain => :local inst.install a_gem - assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map {|s| s.full_name } end if defined? OpenSSL def test_install_security_policy util_setup_gems - data = File.open(@a1_gem, 'rb') { |f| f.read } + data = File.open(@a1_gem, 'rb') {|f| f.read } @fetcher.data['http://gems.example.com/gems/a-1.gem'] = data - data = File.open(@b1_gem, 'rb') { |f| f.read } + data = File.open(@b1_gem, 'rb') {|f| f.read } @fetcher.data['http://gems.example.com/gems/b-1.gem'] = data policy = Gem::Security::HighSecurity @@ -861,7 +861,7 @@ class TestGemDependencyInstaller < Gem::TestCase assert_equal 'unsigned gems are not allowed by the High Security policy', e.message - assert_equal %w[], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[], inst.installed_gems.map {|s| s.full_name } end end @@ -883,32 +883,32 @@ class TestGemDependencyInstaller < Gem::TestCase def test_install_version util_setup_d - data = File.open(@d2_gem, 'rb') { |f| f.read } + data = File.open(@d2_gem, 'rb') {|f| f.read } @fetcher.data['http://gems.example.com/gems/d-2.gem'] = data - data = File.open(@d1_gem, 'rb') { |f| f.read } + data = File.open(@d1_gem, 'rb') {|f| f.read } @fetcher.data['http://gems.example.com/gems/d-1.gem'] = data inst = Gem::DependencyInstaller.new inst.install 'd', '= 1' - assert_equal %w[d-1], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[d-1], inst.installed_gems.map {|s| s.full_name } end def test_install_version_default util_setup_d - data = File.open(@d2_gem, 'rb') { |f| f.read } + data = File.open(@d2_gem, 'rb') {|f| f.read } @fetcher.data['http://gems.example.com/gems/d-2.gem'] = data - data = File.open(@d1_gem, 'rb') { |f| f.read } + data = File.open(@d1_gem, 'rb') {|f| f.read } @fetcher.data['http://gems.example.com/gems/d-1.gem'] = data inst = Gem::DependencyInstaller.new inst.install 'd' - assert_equal %w[d-2], inst.installed_gems.map { |s| s.full_name } + assert_equal %w[d-2], inst.installed_gems.map {|s| s.full_name } end def test_find_gems_gems_with_sources @@ -972,8 +972,8 @@ class TestGemDependencyInstaller < Gem::TestCase releases = set.all_specs - assert releases.any? { |s| s.name == 'a' and s.version.to_s == '1' } - refute releases.any? { |s| s.name == 'a' and s.version.to_s == '1.a' } + assert releases.any? {|s| s.name == 'a' and s.version.to_s == '1' } + refute releases.any? {|s| s.name == 'a' and s.version.to_s == '1.a' } dependency.prerelease = true @@ -1031,7 +1031,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst = Gem::DependencyInstaller.new request_set = inst.resolve_dependencies 'b', req('>= 0') - requests = request_set.sorted_requests.map { |req| req.full_name } + requests = request_set.sorted_requests.map {|req| req.full_name } assert_equal %w[a-1 b-1], requests end @@ -1045,7 +1045,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst = Gem::DependencyInstaller.new :ignore_dependencies => true request_set = inst.resolve_dependencies 'b', req('>= 0') - requests = request_set.sorted_requests.map { |req| req.full_name } + requests = request_set.sorted_requests.map {|req| req.full_name } assert request_set.ignore_dependencies @@ -1062,7 +1062,7 @@ class TestGemDependencyInstaller < Gem::TestCase inst = Gem::DependencyInstaller.new request_set = inst.resolve_dependencies 'a-1.gem', req('>= 0') - requests = request_set.sorted_requests.map { |req| req.full_name } + requests = request_set.sorted_requests.map {|req| req.full_name } assert_equal %w[a-1], requests end diff --git a/test/rubygems/test_gem_dependency_list.rb b/test/rubygems/test_gem_dependency_list.rb index a04d9a756f..1263f2f965 100644 --- a/test/rubygems/test_gem_dependency_list.rb +++ b/test/rubygems/test_gem_dependency_list.rb @@ -53,7 +53,7 @@ class TestGemDependencyList < Gem::TestCase order = @deplist.dependency_order - assert_equal %w[d-1 c-1 b-1 a-1], order.map { |s| s.full_name } + assert_equal %w[d-1 c-1 b-1 a-1], order.map {|s| s.full_name } end def test_dependency_order_circle @@ -62,7 +62,7 @@ class TestGemDependencyList < Gem::TestCase order = @deplist.dependency_order - assert_equal %w[b-1 c-1 a-1], order.map { |s| s.full_name } + assert_equal %w[b-1 c-1 a-1], order.map {|s| s.full_name } end def test_dependency_order_development @@ -80,7 +80,7 @@ class TestGemDependencyList < Gem::TestCase order = deplist.dependency_order - assert_equal %w[g-1 a-1 f-1 e-1], order.map { |s| s.full_name }, + assert_equal %w[g-1 a-1 f-1 e-1], order.map {|s| s.full_name }, 'development on' deplist2 = Gem::DependencyList.new @@ -88,7 +88,7 @@ class TestGemDependencyList < Gem::TestCase order = deplist2.dependency_order - assert_equal %w[a-1 g-1 f-1 e-1], order.map { |s| s.full_name }, + assert_equal %w[a-1 g-1 f-1 e-1], order.map {|s| s.full_name }, 'development off' end @@ -100,7 +100,7 @@ class TestGemDependencyList < Gem::TestCase order = @deplist.dependency_order - assert_equal %w[d-1 c-2 b-1 a-2 e-1], order.map { |s| s.full_name }, + assert_equal %w[d-1 c-2 b-1 a-2 e-1], order.map {|s| s.full_name }, 'deps of trimmed specs not included' end @@ -109,7 +109,7 @@ class TestGemDependencyList < Gem::TestCase order = @deplist.dependency_order - assert_equal %w[c-2 a-1], order.map { |s| s.full_name } + assert_equal %w[c-2 a-1], order.map {|s| s.full_name } end def test_find_name diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index 76828917ec..63e244bf28 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -721,7 +721,7 @@ gem 'other', version installer.generate_bin default_shebang = Gem.ruby - shebang_line = open("#{@gemhome}/bin/executable") { |f| f.readlines.first } + shebang_line = open("#{@gemhome}/bin/executable") {|f| f.readlines.first } assert_match(/\A#!/, shebang_line) assert_match(/#{default_shebang}/, shebang_line) end @@ -1383,7 +1383,7 @@ gem 'other', version installer.install end - expected = File.join @spec.full_require_paths.find { |path| + expected = File.join @spec.full_require_paths.find {|path| File.exist? File.join path, 'b.rb' }, 'b.rb' assert_equal expected, @spec.matches_for_glob('b.rb').first diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb index b328d20b3a..a60817b742 100644 --- a/test/rubygems/test_gem_package.rb +++ b/test/rubygems/test_gem_package.rb @@ -443,7 +443,7 @@ class TestGemPackage < Gem::Package::TarTestCase end def test_raw_spec - data_tgz = util_tar_gz { } + data_tgz = util_tar_gz {} gem = util_tar do |tar| tar.add_file 'data.tar.gz', 0644 do |io| @@ -490,7 +490,7 @@ class TestGemPackage < Gem::Package::TarTestCase end def test_extract_files_empty - data_tgz = util_tar_gz { } + data_tgz = util_tar_gz {} gem = util_tar do |tar| tar.add_file 'data.tar.gz', 0644 do |io| diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb index 903d681c7e..5f80d1a007 100644 --- a/test/rubygems/test_gem_package_tar_writer.rb +++ b/test/rubygems/test_gem_package_tar_writer.rb @@ -202,7 +202,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase end def test_add_file_simple_data - @tar_writer.add_file_simple("lib/foo/bar", 0, 10) { |f| f.write @data } + @tar_writer.add_file_simple("lib/foo/bar", 0, 10) {|f| f.write @data } @tar_writer.flush assert_equal @data + ("\0" * (512 - @data.size)), diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 0781458849..e39c57d7cd 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -712,7 +712,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== assert_fetch_s3 url, '20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b' end ensure - ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS')} + ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS') } Gem.configuration[:s3_source] = nil end @@ -728,7 +728,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== assert_fetch_s3 url, '4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9', nil, 'us-west-2' end ensure - ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS')} + ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS') } Gem.configuration[:s3_source] = nil end @@ -744,7 +744,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== assert_fetch_s3 url, '935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c', 'testtoken' end ensure - ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS')} + ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS') } Gem.configuration[:s3_source] = nil end @@ -1102,7 +1102,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== :Logger => null_logger, :AccessLog => null_logger ) - s.mount_proc("/kill") { |req, res| s.shutdown } + s.mount_proc("/kill") {|req, res| s.shutdown } s.mount_proc("/yaml") do |req, res| if req["X-Captain"] res.body = req["X-Captain"] diff --git a/test/rubygems/test_gem_request_set.rb b/test/rubygems/test_gem_request_set.rb index 98efe5db48..afe1732f5e 100644 --- a/test/rubygems/test_gem_request_set.rb +++ b/test/rubygems/test_gem_request_set.rb @@ -324,7 +324,7 @@ ruby "0" res = rs.resolve StaticSet.new([a, b]) assert_equal 2, res.size - names = res.map { |s| s.full_name }.sort + names = res.map {|s| s.full_name }.sort assert_equal ["a-2", "b-2"], names @@ -343,7 +343,7 @@ ruby "0" res = rs.resolve StaticSet.new([a, b, c]) assert_equal 3, res.size - names = res.map { |s| s.full_name }.sort + names = res.map {|s| s.full_name }.sort assert_equal %w[a-1.b b-1.b c-1.1.b], names end @@ -410,12 +410,12 @@ ruby "0" res = rs.resolve assert_equal 1, res.size - names = res.map { |s| s.full_name }.sort + names = res.map {|s| s.full_name }.sort assert_equal %w[a-1], names assert_equal [@DR::BestSet, @DR::GitSet, @DR::VendorSet, @DR::SourceSet], - rs.sets.map { |set| set.class } + rs.sets.map {|set| set.class } end def test_resolve_ignore_dependencies @@ -429,7 +429,7 @@ ruby "0" res = rs.resolve StaticSet.new([a, b]) assert_equal 1, res.size - names = res.map { |s| s.full_name }.sort + names = res.map {|s| s.full_name }.sort assert_equal %w[a-2], names end @@ -474,12 +474,12 @@ ruby "0" res = rs.resolve assert_equal 2, res.size - names = res.map { |s| s.full_name }.sort + names = res.map {|s| s.full_name }.sort assert_equal ["a-1", "b-2"], names assert_equal [@DR::BestSet, @DR::GitSet, @DR::VendorSet, @DR::SourceSet], - rs.sets.map { |set| set.class } + rs.sets.map {|set| set.class } end def test_sorted_requests @@ -492,7 +492,7 @@ ruby "0" rs.resolve StaticSet.new([a, b, c]) - names = rs.sorted_requests.map { |s| s.full_name } + names = rs.sorted_requests.map {|s| s.full_name } assert_equal %w[c-2 b-2 a-2], names end @@ -521,14 +521,14 @@ ruby "0" installers << installer end - assert_equal %w[b-1 a-1], reqs.map { |req| req.full_name } + assert_equal %w[b-1 a-1], reqs.map {|req| req.full_name } assert_equal %w[b-1 a-1], - installers.map { |installer| installer.spec.full_name } + installers.map {|installer| installer.spec.full_name } assert_path_exists File.join @gemhome, 'specifications', 'a-1.gemspec' assert_path_exists File.join @gemhome, 'specifications', 'b-1.gemspec' - assert_equal %w[b-1 a-1], installed.map { |s| s.full_name } + assert_equal %w[b-1 a-1], installed.map {|s| s.full_name } assert done_installing_ran end @@ -551,7 +551,7 @@ ruby "0" assert_path_exists File.join @tempdir, 'specifications', 'a-1.gemspec' assert_path_exists File.join @tempdir, 'specifications', 'b-1.gemspec' - assert_equal %w[b-1 a-1], installed.map { |s| s.full_name } + assert_equal %w[b-1 a-1], installed.map {|s| s.full_name } end def test_install_into_development_shallow @@ -583,7 +583,7 @@ ruby "0" assert_equal @tempdir, ENV['GEM_HOME'] end - assert_equal %w[a-1 b-1], installed.map { |s| s.full_name }.sort + assert_equal %w[a-1 b-1], installed.map {|s| s.full_name }.sort end def test_sorted_requests_development_shallow @@ -608,7 +608,7 @@ ruby "0" rs.resolve StaticSet.new [a_spec, b_spec, c_spec] - assert_equal %w[b-1 a-1], rs.sorted_requests.map { |req| req.full_name } + assert_equal %w[b-1 a-1], rs.sorted_requests.map {|req| req.full_name } end def test_tsort_each_child_development @@ -637,7 +637,7 @@ ruby "0" deps = rs.enum_for(:tsort_each_child, a_req).to_a - assert_equal %w[b], deps.map { |dep| dep.name } + assert_equal %w[b], deps.map {|dep| dep.name } end def test_tsort_each_child_development_shallow diff --git a/test/rubygems/test_gem_request_set_gem_dependency_api.rb b/test/rubygems/test_gem_request_set_gem_dependency_api.rb index bb261ee9cb..ca7e53d24c 100644 --- a/test/rubygems/test_gem_request_set_gem_dependency_api.rb +++ b/test/rubygems/test_gem_request_set_gem_dependency_api.rb @@ -50,7 +50,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase end @gda.gemspec assert_equal %w[ foo bar ].sort, @set.dependencies.map(&:name).sort - bar = @set.dependencies.find { |d| d.name == 'bar' } + bar = @set.dependencies.find {|d| d.name == 'bar' } assert_equal [["<", Gem::Version.create('1.6.4')], [">=", Gem::Version.create('1.6.0')]], bar.requirement.requirements.sort end @@ -490,7 +490,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase groups = @gda.send :gem_group, 'a', :group => :b, :groups => [:c, :d] end - assert_equal [:a, :b, :c, :d], groups.sort_by { |group| group.to_s } + assert_equal [:a, :b, :c, :d], groups.sort_by {|group| group.to_s } end def test_gemspec diff --git a/test/rubygems/test_gem_request_set_lockfile_parser.rb b/test/rubygems/test_gem_request_set_lockfile_parser.rb index 7fc93c36e5..f75c9b9b3e 100644 --- a/test/rubygems/test_gem_request_set_lockfile_parser.rb +++ b/test/rubygems/test_gem_request_set_lockfile_parser.rb @@ -94,7 +94,7 @@ DEPENDENCIES assert lockfile_set, 'could not find a LockSet' - assert_equal %w[a-2], lockfile_set.specs.map { |tuple| tuple.full_name } + assert_equal %w[a-2], lockfile_set.specs.map {|tuple| tuple.full_name } end def test_parse_dependencies @@ -124,7 +124,7 @@ DEPENDENCIES assert lockfile_set, 'could not find a LockSet' - assert_equal %w[a-2], lockfile_set.specs.map { |tuple| tuple.full_name } + assert_equal %w[a-2], lockfile_set.specs.map {|tuple| tuple.full_name } end def test_parse_DEPENDENCIES_git @@ -218,7 +218,7 @@ DEPENDENCIES assert lockfile_set, 'found a LockSet' - assert_equal %w[a-2], lockfile_set.specs.map { |s| s.full_name } + assert_equal %w[a-2], lockfile_set.specs.map {|s| s.full_name } end def test_parse_GEM_remote_multiple @@ -246,10 +246,10 @@ DEPENDENCIES assert lockfile_set, 'found a LockSet' - assert_equal %w[a-2], lockfile_set.specs.map { |s| s.full_name } + 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 @@ -284,7 +284,7 @@ DEPENDENCIES assert git_set, 'could not find a GitSet' - assert_equal %w[a-2], git_set.specs.values.map { |s| s.full_name } + assert_equal %w[a-2], git_set.specs.values.map {|s| s.full_name } assert_equal [dep('b', '>= 3'), dep('c')], git_set.specs.values.first.dependencies @@ -438,7 +438,7 @@ DEPENDENCIES assert vendor_set, 'could not find a VendorSet' - assert_equal %w[a-1], vendor_set.specs.values.map { |s| s.full_name } + assert_equal %w[a-1], vendor_set.specs.values.map {|s| s.full_name } spec = vendor_set.load_spec 'a', nil, nil, nil @@ -497,14 +497,14 @@ DEPENDENCIES assert lockfile_set, 'could not find a LockSet' - assert_equal %w[a-2 b-3], lockfile_set.specs.map { |tuple| tuple.full_name } + assert_equal %w[a-2 b-3], lockfile_set.specs.map {|tuple| tuple.full_name } expected = [ Gem::Platform::RUBY, Gem::Platform.new('x86_64-linux'), ] - assert_equal expected, lockfile_set.specs.map { |tuple| tuple.platform } + assert_equal expected, lockfile_set.specs.map {|tuple| tuple.platform } spec = lockfile_set.specs.first diff --git a/test/rubygems/test_gem_requirement.rb b/test/rubygems/test_gem_requirement.rb index 3db393e978..18ea2a872d 100644 --- a/test/rubygems/test_gem_requirement.rb +++ b/test/rubygems/test_gem_requirement.rb @@ -390,8 +390,8 @@ class TestGemRequirement < Gem::TestCase r2 = req('2.0', '1.0') assert_equal r1.hash, r2.hash - r1 = req('1.0', '2.0').tap { |r| r.concat(['3.0']) } - r2 = req('3.0', '1.0').tap { |r| r.concat(['2.0']) } + r1 = req('1.0', '2.0').tap {|r| r.concat(['3.0']) } + r2 = req('3.0', '1.0').tap {|r| r.concat(['2.0']) } assert_equal r1.hash, r2.hash end diff --git a/test/rubygems/test_gem_resolver.rb b/test/rubygems/test_gem_resolver.rb index 7ace86caea..83442adb32 100644 --- a/test/rubygems/test_gem_resolver.rb +++ b/test/rubygems/test_gem_resolver.rb @@ -26,10 +26,10 @@ class TestGemResolver < Gem::TestCase def assert_resolves_to(expected, resolver) actual = resolver.resolve - exp = expected.sort_by { |s| s.full_name } - act = actual.map { |a| a.spec.spec }.sort_by { |s| s.full_name } + exp = expected.sort_by {|s| s.full_name } + act = actual.map {|a| a.spec.spec }.sort_by {|s| s.full_name } - msg = "Set of gems was not the same: #{exp.map { |x| x.full_name}.inspect} != #{act.map { |x| x.full_name}.inspect}" + msg = "Set of gems was not the same: #{exp.map {|x| x.full_name }.inspect} != #{act.map {|x| x.full_name }.inspect}" assert_equal exp, act, msg rescue Gem::DependencyResolutionError => e @@ -105,7 +105,7 @@ class TestGemResolver < Gem::TestCase res.requests a1, act, reqs - assert_equal ['b (= 2)'], reqs.map { |req| req.to_s } + assert_equal ['b (= 2)'], reqs.map {|req| req.to_s } end def test_requests_development @@ -127,7 +127,7 @@ class TestGemResolver < Gem::TestCase res.requests spec, act, reqs - assert_equal ['b (= 2)'], reqs.map { |req| req.to_s } + assert_equal ['b (= 2)'], reqs.map {|req| req.to_s } assert spec.instance_variable_defined? :@called end diff --git a/test/rubygems/test_gem_resolver_api_set.rb b/test/rubygems/test_gem_resolver_api_set.rb index 79c286d292..b79e01d074 100644 --- a/test/rubygems/test_gem_resolver_api_set.rb +++ b/test/rubygems/test_gem_resolver_api_set.rb @@ -128,7 +128,7 @@ class TestGemResolverAPISet < Gem::TestCase set.prefetch [a_dep, b_dep] - assert_equal %w[a-1], set.find_all(a_dep).map { |s| s.full_name } + assert_equal %w[a-1], set.find_all(a_dep).map {|s| s.full_name } assert_empty set.find_all(b_dep) end diff --git a/test/rubygems/test_gem_resolver_best_set.rb b/test/rubygems/test_gem_resolver_best_set.rb index dc6c9b4c44..34c2c76d64 100644 --- a/test/rubygems/test_gem_resolver_best_set.rb +++ b/test/rubygems/test_gem_resolver_best_set.rb @@ -30,7 +30,7 @@ class TestGemResolverBestSet < Gem::TestCase found = set.find_all req - assert_equal %w[a-1], found.map { |s| s.full_name } + assert_equal %w[a-1], found.map {|s| s.full_name } end def test_find_all_fallback @@ -50,7 +50,7 @@ class TestGemResolverBestSet < Gem::TestCase found = set.find_all req - assert_equal %w[a-1], found.map { |s| s.full_name } + assert_equal %w[a-1], found.map {|s| s.full_name } end def test_find_all_local diff --git a/test/rubygems/test_gem_resolver_index_set.rb b/test/rubygems/test_gem_resolver_index_set.rb index d9a30d0f58..2195a7bb5d 100644 --- a/test/rubygems/test_gem_resolver_index_set.rb +++ b/test/rubygems/test_gem_resolver_index_set.rb @@ -42,7 +42,7 @@ class TestGemResolverIndexSet < Gem::TestCase found = set.find_all req - assert_equal %w[a-1], found.map { |s| s.full_name } + assert_equal %w[a-1], found.map {|s| s.full_name } end def test_find_all_local @@ -83,7 +83,7 @@ class TestGemResolverIndexSet < Gem::TestCase found = set.find_all req - assert_equal %w[a-1.a], found.map { |s| s.full_name } + assert_equal %w[a-1.a], found.map {|s| s.full_name } end end diff --git a/test/rubygems/test_gem_resolver_installer_set.rb b/test/rubygems/test_gem_resolver_installer_set.rb index 5138743cdf..019ca4814f 100644 --- a/test/rubygems/test_gem_resolver_installer_set.rb +++ b/test/rubygems/test_gem_resolver_installer_set.rb @@ -15,7 +15,7 @@ class TestGemResolverInstallerSet < Gem::TestCase set.add_always_install dep('a') - assert_equal %w[a-2], set.always_install.map { |s| s.full_name } + assert_equal %w[a-2], set.always_install.map {|s| s.full_name } e = assert_raises Gem::UnsatisfiableDependencyError do set.add_always_install dep('b') @@ -49,7 +49,7 @@ class TestGemResolverInstallerSet < Gem::TestCase set.add_always_install dep('a') - assert_equal %w[a-1], set.always_install.map { |s| s.full_name } + assert_equal %w[a-1], set.always_install.map {|s| s.full_name } end def test_add_always_install_prerelease @@ -62,7 +62,7 @@ class TestGemResolverInstallerSet < Gem::TestCase set.add_always_install dep('a') - assert_equal %w[a-1], set.always_install.map { |s| s.full_name } + assert_equal %w[a-1], set.always_install.map {|s| s.full_name } end def test_add_always_install_prerelease_only @@ -93,7 +93,7 @@ class TestGemResolverInstallerSet < Gem::TestCase req = Gem::Resolver::DependencyRequest.new dep('a'), nil - assert_equal %w[a-1], set.find_all(req).map { |spec| spec.full_name } + assert_equal %w[a-1], set.find_all(req).map {|spec| spec.full_name } end def test_consider_local_eh @@ -149,7 +149,7 @@ class TestGemResolverInstallerSet < Gem::TestCase req = Gem::Resolver::DependencyRequest.new dep('a'), nil - assert_equal %w[a-2], set.find_all(req).map { |spec| spec.full_name } + assert_equal %w[a-2], set.find_all(req).map {|spec| spec.full_name } end def test_find_all_prerelease @@ -162,12 +162,12 @@ class TestGemResolverInstallerSet < Gem::TestCase req = Gem::Resolver::DependencyRequest.new dep('a'), nil - assert_equal %w[a-1], set.find_all(req).map { |spec| spec.full_name } + assert_equal %w[a-1], set.find_all(req).map {|spec| spec.full_name } req = Gem::Resolver::DependencyRequest.new dep('a', '>= 0.a'), nil assert_equal %w[a-1 a-1.a], - set.find_all(req).map { |spec| spec.full_name }.sort + set.find_all(req).map {|spec| spec.full_name }.sort end def test_load_spec diff --git a/test/rubygems/test_gem_resolver_lock_set.rb b/test/rubygems/test_gem_resolver_lock_set.rb index d5258477d7..e1c8746b72 100644 --- a/test/rubygems/test_gem_resolver_lock_set.rb +++ b/test/rubygems/test_gem_resolver_lock_set.rb @@ -16,7 +16,7 @@ class TestGemResolverLockSet < Gem::TestCase specs = @set.add 'a', '2', Gem::Platform::RUBY spec = specs.first - assert_equal %w[a-2], @set.specs.map { |t| t.full_name } + assert_equal %w[a-2], @set.specs.map {|t| t.full_name } assert_kind_of Gem::Resolver::LockSpecification, spec @@ -34,11 +34,11 @@ class TestGemResolverLockSet < Gem::TestCase found = @set.find_all dep 'a' - assert_equal %w[a-2], found.map { |s| s.full_name } + assert_equal %w[a-2], found.map {|s| s.full_name } found = @set.find_all dep 'a', '>= 0.a' - assert_equal %w[a-1.a a-2], found.map { |s| s.full_name } + assert_equal %w[a-1.a a-2], found.map {|s| s.full_name } end def test_load_spec diff --git a/test/rubygems/test_gem_security.rb b/test/rubygems/test_gem_security.rb index 71185dc86e..172dd10316 100644 --- a/test/rubygems/test_gem_security.rb +++ b/test/rubygems/test_gem_security.rb @@ -40,16 +40,16 @@ class TestGemSecurity < Gem::TestCase assert_equal name.to_s, cert.subject.to_s assert_equal 3, cert.extensions.length, - cert.extensions.map { |e| e.to_a.first } + cert.extensions.map {|e| e.to_a.first } - constraints = cert.extensions.find { |ext| ext.oid == 'basicConstraints' } + constraints = cert.extensions.find {|ext| ext.oid == 'basicConstraints' } assert_equal 'CA:FALSE', constraints.value - key_usage = cert.extensions.find { |ext| ext.oid == 'keyUsage' } + key_usage = cert.extensions.find {|ext| ext.oid == 'keyUsage' } assert_equal 'Digital Signature, Key Encipherment, Data Encipherment', key_usage.value - key_ident = cert.extensions.find { |ext| ext.oid == 'subjectKeyIdentifier' } + key_ident = cert.extensions.find {|ext| ext.oid == 'subjectKeyIdentifier' } assert_equal 59, key_ident.value.length assert_equal '5F:43:6E:F6:9A:8E:45:25:E9:22:E3:7D:37:5E:A4:D5:36:02:85:1B', key_ident.value @@ -85,19 +85,19 @@ class TestGemSecurity < Gem::TestCase assert_equal name.to_s, cert.issuer.to_s assert_equal 5, cert.extensions.length, - cert.extensions.map { |e| e.to_a.first } + cert.extensions.map {|e| e.to_a.first } - constraints = cert.extensions.find { |ext| ext.oid == 'subjectAltName' } + constraints = cert.extensions.find {|ext| ext.oid == 'subjectAltName' } assert_equal 'email:nobody@example', constraints.value - constraints = cert.extensions.find { |ext| ext.oid == 'basicConstraints' } + constraints = cert.extensions.find {|ext| ext.oid == 'basicConstraints' } assert_equal 'CA:FALSE', constraints.value - key_usage = cert.extensions.find { |ext| ext.oid == 'keyUsage' } + key_usage = cert.extensions.find {|ext| ext.oid == 'keyUsage' } assert_equal 'Digital Signature, Key Encipherment, Data Encipherment', key_usage.value - key_ident = cert.extensions.find { |ext| ext.oid == 'subjectKeyIdentifier' } + key_ident = cert.extensions.find {|ext| ext.oid == 'subjectKeyIdentifier' } assert_equal 59, key_ident.value.length assert_equal '5F:43:6E:F6:9A:8E:45:25:E9:22:E3:7D:37:5E:A4:D5:36:02:85:1B', key_ident.value @@ -188,20 +188,20 @@ class TestGemSecurity < Gem::TestCase assert_in_delta Time.now + 60, signed.not_after, 10 assert_equal 4, signed.extensions.length, - signed.extensions.map { |e| e.to_a.first } + signed.extensions.map {|e| e.to_a.first } - constraints = signed.extensions.find { |ext| ext.oid == 'issuerAltName' } + constraints = signed.extensions.find {|ext| ext.oid == 'issuerAltName' } assert_equal 'email:nobody@example', constraints.value, 'issuerAltName' - constraints = signed.extensions.find { |ext| ext.oid == 'basicConstraints' } + constraints = signed.extensions.find {|ext| ext.oid == 'basicConstraints' } assert_equal 'CA:FALSE', constraints.value - key_usage = signed.extensions.find { |ext| ext.oid == 'keyUsage' } + key_usage = signed.extensions.find {|ext| ext.oid == 'keyUsage' } assert_equal 'Digital Signature, Key Encipherment, Data Encipherment', key_usage.value key_ident = - signed.extensions.find { |ext| ext.oid == 'subjectKeyIdentifier' } + signed.extensions.find {|ext| ext.oid == 'subjectKeyIdentifier' } assert_equal 59, key_ident.value.length assert_equal '5F:43:6E:F6:9A:8E:45:25:E9:22:E3:7D:37:5E:A4:D5:36:02:85:1B', key_ident.value @@ -227,23 +227,23 @@ class TestGemSecurity < Gem::TestCase assert_equal "sha256WithRSAEncryption", signed.signature_algorithm assert_equal 5, signed.extensions.length, - signed.extensions.map { |e| e.to_a.first } + signed.extensions.map {|e| e.to_a.first } - constraints = signed.extensions.find { |ext| ext.oid == 'issuerAltName' } + constraints = signed.extensions.find {|ext| ext.oid == 'issuerAltName' } assert_equal 'email:nobody@example', constraints.value, 'issuerAltName' - constraints = signed.extensions.find { |ext| ext.oid == 'subjectAltName' } + constraints = signed.extensions.find {|ext| ext.oid == 'subjectAltName' } assert_equal 'email:signee@example', constraints.value, 'subjectAltName' - constraints = signed.extensions.find { |ext| ext.oid == 'basicConstraints' } + constraints = signed.extensions.find {|ext| ext.oid == 'basicConstraints' } assert_equal 'CA:FALSE', constraints.value - key_usage = signed.extensions.find { |ext| ext.oid == 'keyUsage' } + key_usage = signed.extensions.find {|ext| ext.oid == 'keyUsage' } assert_equal 'Digital Signature, Key Encipherment, Data Encipherment', key_usage.value key_ident = - signed.extensions.find { |ext| ext.oid == 'subjectKeyIdentifier' } + signed.extensions.find {|ext| ext.oid == 'subjectKeyIdentifier' } assert_equal 59, key_ident.value.length assert_equal '5F:43:6E:F6:9A:8E:45:25:E9:22:E3:7D:37:5E:A4:D5:36:02:85:1B', key_ident.value diff --git a/test/rubygems/test_gem_security_signer.rb b/test/rubygems/test_gem_security_signer.rb index b9d5e9848f..df1ffbac8a 100644 --- a/test/rubygems/test_gem_security_signer.rb +++ b/test/rubygems/test_gem_security_signer.rb @@ -37,8 +37,8 @@ class TestGemSecuritySigner < Gem::TestCase def test_initialize_cert_chain_mixed signer = Gem::Security::Signer.new nil, [@cert_file, CHILD_CERT] - assert_equal [PUBLIC_CERT, CHILD_CERT].map { |c| c.to_pem }, - signer.cert_chain.map { |c| c.to_pem } + assert_equal [PUBLIC_CERT, CHILD_CERT].map {|c| c.to_pem }, + signer.cert_chain.map {|c| c.to_pem } end def test_initialize_cert_chain_invalid @@ -50,8 +50,8 @@ class TestGemSecuritySigner < Gem::TestCase def test_initialize_cert_chain_path signer = Gem::Security::Signer.new nil, [@cert_file] - assert_equal [PUBLIC_CERT].map { |c| c.to_pem }, - signer.cert_chain.map { |c| c.to_pem } + assert_equal [PUBLIC_CERT].map {|c| c.to_pem }, + signer.cert_chain.map {|c| c.to_pem } end def test_initialize_default @@ -66,7 +66,7 @@ class TestGemSecuritySigner < Gem::TestCase signer = Gem::Security::Signer.new nil, nil assert_equal PRIVATE_KEY.to_pem, signer.key.to_pem - assert_equal [PUBLIC_CERT.to_pem], signer.cert_chain.map { |c| c.to_pem } + assert_equal [PUBLIC_CERT.to_pem], signer.cert_chain.map {|c| c.to_pem } end def test_initialize_key_path @@ -100,7 +100,7 @@ class TestGemSecuritySigner < Gem::TestCase signer.load_cert_chain assert_equal [PUBLIC_CERT.to_pem, CHILD_CERT.to_pem], - signer.cert_chain.map { |c| c.to_pem } + signer.cert_chain.map {|c| c.to_pem } end def test_load_cert_chain_broken @@ -112,7 +112,7 @@ class TestGemSecuritySigner < Gem::TestCase signer.load_cert_chain assert_equal [CHILD_CERT.to_pem, GRANDCHILD_CERT.to_pem], - signer.cert_chain.map { |c| c.to_pem } + signer.cert_chain.map {|c| c.to_pem } end def test_sign diff --git a/test/rubygems/test_gem_source.rb b/test/rubygems/test_gem_source.rb index 3b533febe4..72f0878bcc 100644 --- a/test/rubygems/test_gem_source.rb +++ b/test/rubygems/test_gem_source.rb @@ -123,7 +123,7 @@ class TestGemSource < Gem::TestCase end def test_load_specs - released = @source.load_specs(:released).map { |spec| spec.full_name } + released = @source.load_specs(:released).map {|spec| spec.full_name } assert_equal %W[a-2 a-1 b-2], released cache_dir = File.join Gem.spec_cache_dir, 'gems.example.com%80' diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index 54107a2b9f..bcf97e367f 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -187,7 +187,7 @@ class TestGemSourceGit < Gem::TestCase source.cache e = assert_raises Gem::Exception do - capture_subprocess_io {source.rev_parse} + capture_subprocess_io { source.rev_parse } end assert_equal "unable to find reference nonexistent in #{@repository}", @@ -244,7 +244,7 @@ class TestGemSourceGit < Gem::TestCase specs = source.specs end - assert_equal %w[a-1 b-1], specs.map { |spec| spec.full_name } + assert_equal %w[a-1 b-1], specs.map {|spec| spec.full_name } a_spec = specs.shift diff --git a/test/rubygems/test_gem_source_local.rb b/test/rubygems/test_gem_source_local.rb index 5a61e63a39..c2d4d6cd10 100644 --- a/test/rubygems/test_gem_source_local.rb +++ b/test/rubygems/test_gem_source_local.rb @@ -73,7 +73,7 @@ class TestGemSourceLocal < Gem::TestCase @sl.load_specs :released - inner = [@a, @ap, @b].map { |t| t.name_tuple }.inspect + inner = [@a, @ap, @b].map {|t| t.name_tuple }.inspect assert_equal "#<Gem::Source::Local specs: #{inner}>", @sl.inspect end diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index d0f11bfa02..0733899be0 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -720,7 +720,7 @@ end version ] - actual_value = Gem::Specification.attribute_names.map { |a| a.to_s }.sort + actual_value = Gem::Specification.attribute_names.map {|a| a.to_s }.sort assert_equal expected_value, actual_value end @@ -1113,13 +1113,13 @@ dependencies: [] install_specs @a1 assert_includes Gem::Specification.all_names, 'a-1' - assert_includes Gem::Specification.stubs.map { |s| s.full_name }, 'a-1' + assert_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1' uninstall_gem @a1 Gem::Specification.reset refute_includes Gem::Specification.all_names, 'a-1' - refute_includes Gem::Specification.stubs.map { |s| s.full_name }, 'a-1' + refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1' end def test_self_remove_spec_removed @@ -1134,7 +1134,7 @@ dependencies: [] Gem::Specification.reset refute_includes Gem::Specification.all_names, 'a-1' - refute_includes Gem::Specification.stubs.map { |s| s.full_name }, 'a-1' + refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1' end def test_self_stubs_for_lazy_loading @@ -1146,14 +1146,14 @@ dependencies: [] 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 ['a-1'], Gem::Specification.stubs_for('a').map {|s| s.full_name } assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length - assert_equal ['b-1'], Gem::Specification.stubs_for('b').map { |s| s.full_name } + assert_equal ['b-1'], Gem::Specification.stubs_for('b').map {|s| s.full_name } assert_equal 2, Gem::Specification.class_variable_get(:@@stubs_by_name).length assert_equal( - Gem::Specification.stubs_for('a').map { |s| s.object_id }, - Gem::Specification.stubs_for('a').map { |s| s.object_id } + Gem::Specification.stubs_for('a').map {|s| s.object_id }, + Gem::Specification.stubs_for('a').map {|s| s.object_id } ) Gem.loaded_specs.delete 'a' @@ -1179,7 +1179,7 @@ dependencies: [] #create specs platforms.each do |plat| - spec = Gem::Specification.new(gem, v) { |s| s.platform = plat } + spec = Gem::Specification.new(gem, v) {|s| s.platform = plat } File.open File.join(user_spec_dir, "#{gem}-#{v}-#{plat}.gemspec"), 'w' do |io| io.write spec.to_ruby end @@ -1370,12 +1370,12 @@ dependencies: [] awesome.add_dependency :gem_name end - assert_equal %w[true gem_name], gem.dependencies.map { |dep| dep.name } + assert_equal %w[true gem_name], gem.dependencies.map {|dep| dep.name } end def test_add_dependency_from_existing_dependency dep = Gem::Dependency.new("existing_dep", Gem::Requirement.new('> 1'), :runtime) - spec = Gem::Specification.new { |s| s.add_dependency dep } + spec = Gem::Specification.new {|s| s.add_dependency dep } assert_equal dep, spec.dependencies.first end @@ -1384,7 +1384,7 @@ dependencies: [] awesome.add_development_dependency "monkey" end - monkey = gem.dependencies.detect { |d| d.name == "monkey" } + monkey = gem.dependencies.detect {|d| d.name == "monkey" } assert_equal(:development, monkey.type) end @@ -1482,7 +1482,7 @@ dependencies: [] default = new_default_spec 'default', 2 install_default_gems default - stub = Gem::Specification.stubs.find { |s| s.name == 'default' } + stub = Gem::Specification.stubs.find {|s| s.name == 'default' } assert_predicate stub, :default_gem? stub = Gem::Specification.find_all_by_name('default').first @@ -2330,7 +2330,7 @@ dependencies: [] expected = %w[rake jabber4r pqa] - assert_equal expected, @c1.runtime_dependencies.map { |d| d.name } + assert_equal expected, @c1.runtime_dependencies.map {|d| d.name } end def test_spaceship_name @@ -3040,8 +3040,8 @@ Please report a bug if this causes problems. specification.define_singleton_method(:find_all_by_name) do |dep_name| [ - specification.new { |s| s.name = "z", s.version = Gem::Version.new("1") }, - specification.new { |s| s.name = "z", s.version = Gem::Version.new("2") } + specification.new {|s| s.name = "z", s.version = Gem::Version.new("1") }, + specification.new {|s| s.name = "z", s.version = Gem::Version.new("2") } ] end diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb index 387dff0d8a..cf90350763 100644 --- a/test/rubygems/test_gem_util.rb +++ b/test/rubygems/test_gem_util.rb @@ -56,8 +56,8 @@ class TestGemUtil < Gem::TestCase list = [1,2,3,4,5].inject(Gem::List.new(0)) do |m,o| Gem::List.new o, m end - assert_equal 5, list.find { |x| x == 5 } - assert_equal 4, list.find { |x| x == 4 } + assert_equal 5, list.find {|x| x == 5 } + assert_equal 4, list.find {|x| x == 4 } end def test_glob_files_in_dir diff --git a/test/rubygems/test_kernel.rb b/test/rubygems/test_kernel.rb index be8aa4f512..6c07347a9f 100644 --- a/test/rubygems/test_kernel.rb +++ b/test/rubygems/test_kernel.rb @@ -19,7 +19,7 @@ class TestKernel < Gem::TestCase def test_gem assert gem('a', '= 1'), "Should load" - assert $:.any? { |p| %r{a-1/lib} =~ p } + assert $:.any? {|p| %r{a-1/lib} =~ p } end def test_gem_default @@ -49,13 +49,13 @@ class TestKernel < Gem::TestCase def test_gem_redundant assert gem('a', '= 1'), "Should load" refute gem('a', '= 1'), "Should not load" - assert_equal 1, $:.select { |p| %r{a-1/lib} =~ p }.size + assert_equal 1, $:.select {|p| %r{a-1/lib} =~ p }.size end def test_gem_overlapping assert gem('a', '= 1'), "Should load" refute gem('a', '>= 1'), "Should not load" - assert_equal 1, $:.select { |p| %r{a-1/lib} =~ p }.size + assert_equal 1, $:.select {|p| %r{a-1/lib} =~ p }.size end def test_gem_prerelease @@ -82,13 +82,13 @@ class TestKernel < Gem::TestCase assert_match(/activated a-1/, ex.message) assert_equal 'a', ex.name - assert $:.any? { |p| %r{a-1/lib} =~ p } - refute $:.any? { |p| %r{a-2/lib} =~ p } + assert $:.any? {|p| %r{a-1/lib} =~ p } + refute $:.any? {|p| %r{a-2/lib} =~ p } end def test_gem_not_adding_bin assert gem('a', '= 1'), "Should load" - refute $:.any? { |p| %r{a-1/bin} =~ p } + refute $:.any? {|p| %r{a-1/bin} =~ p } end def test_gem_failing_inside_require_doesnt_cause_double_exceptions @@ -103,7 +103,7 @@ class TestKernel < Gem::TestCase "./activate.rb" ) - load_errors = output.split("\n").select { |line| line.include?("Could not find")} + load_errors = output.split("\n").select {|line| line.include?("Could not find") } assert_equal 1, load_errors.size end @@ -113,7 +113,7 @@ class TestKernel < Gem::TestCase quick_gem 'bundler', '2.a' assert gem('bundler') - assert $:.any? { |p| %r{bundler-1/lib} =~ p } + assert $:.any? {|p| %r{bundler-1/lib} =~ p } end def test_gem_bundler_missing_bundler_version @@ -134,7 +134,7 @@ class TestKernel < Gem::TestCase quick_gem 'bundler', '2.a' assert gem('bundler', '>= 0.a') - assert $:.any? { |p| %r{bundler-1/lib} =~ p } + assert $:.any? {|p| %r{bundler-1/lib} =~ p } end end diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb index 5b11b5cebb..d90c3e2744 100644 --- a/test/rubygems/test_require.rb +++ b/test/rubygems/test_require.rb @@ -52,7 +52,7 @@ class TestGemRequire < Gem::TestCase foo1 = File.join lp1, 'foo.rb' FileUtils.mkdir_p lp1 - File.open(foo1, 'w') { |f| f.write "class Object; HELLO = 'foo1' end" } + File.open(foo1, 'w') {|f| f.write "class Object; HELLO = 'foo1' end" } lp = $LOAD_PATH.dup @@ -64,7 +64,7 @@ class TestGemRequire < Gem::TestCase foo2 = File.join lp2, 'foo.rb' FileUtils.mkdir_p lp2 - File.open(foo2, 'w') { |f| f.write "class Object; HELLO = 'foo2' end" } + File.open(foo2, 'w') {|f| f.write "class Object; HELLO = 'foo2' end" } $LOAD_PATH.unshift lp2 refute_require 'foo' @@ -89,7 +89,7 @@ class TestGemRequire < Gem::TestCase c_rb = File.join dash_i_arg, 'b', 'c.rb' FileUtils.mkdir_p File.dirname c_rb - File.open(c_rb, 'w') { |f| f.write "class Object; HELLO = 'world' end" } + File.open(c_rb, 'w') {|f| f.write "class Object; HELLO = 'world' end" } lp = $LOAD_PATH.dup @@ -131,7 +131,7 @@ class TestGemRequire < Gem::TestCase c_rb = File.join dash_i_arg, 'c', 'c.rb' FileUtils.mkdir_p File.dirname c_rb - File.open(c_rb, 'w') { |f| f.write "class Object; HELLO = 'world' end" } + File.open(c_rb, 'w') {|f| f.write "class Object; HELLO = 'world' end" } assert_require 'test_gem_require_a' @@ -421,8 +421,8 @@ class TestGemRequire < Gem::TestCase def test_require_doesnt_traverse_development_dependencies a = util_spec("a#{$$}", "1", nil, "lib/a#{$$}.rb") z = util_spec("z", "1", "w" => "> 0") - w1 = util_spec("w", "1") { |s| s.add_development_dependency "non-existent" } - w2 = util_spec("w", "2") { |s| s.add_development_dependency "non-existent" } + w1 = util_spec("w", "1") {|s| s.add_development_dependency "non-existent" } + w2 = util_spec("w", "2") {|s| s.add_development_dependency "non-existent" } install_specs a, w1, w2, z @@ -736,7 +736,7 @@ class TestGemRequire < Gem::TestCase a_rb = File.join dash_i_lib_arg, "#{name}.rb" FileUtils.mkdir_p File.dirname a_rb - File.open(a_rb, 'w') { |f| f.write "# #{name}.rb" } + File.open(a_rb, 'w') {|f| f.write "# #{name}.rb" } dash_i_lib_arg end |