summaryrefslogtreecommitdiff
path: root/test/rubygems
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/rubygems_plugin.rb1
-rw-r--r--test/rubygems/test_gem.rb81
-rw-r--r--test/rubygems/test_gem_command.rb1
-rw-r--r--test/rubygems/test_gem_command_manager.rb1
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb3
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_signin_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb3
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb1
-rw-r--r--test/rubygems/test_gem_config_file.rb3
-rw-r--r--test/rubygems/test_gem_dependency.rb3
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb5
-rw-r--r--test/rubygems/test_gem_dependency_list.rb1
-rw-r--r--test/rubygems/test_gem_dependency_resolution_error.rb1
-rw-r--r--test/rubygems/test_gem_doctor.rb3
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb8
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb10
-rw-r--r--test/rubygems/test_gem_gem_runner.rb1
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb4
-rw-r--r--test/rubygems/test_gem_impossible_dependencies_error.rb1
-rw-r--r--test/rubygems/test_gem_indexer.rb3
-rw-r--r--test/rubygems/test_gem_installer.rb40
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb1
-rw-r--r--test/rubygems/test_gem_name_tuple.rb1
-rw-r--r--test/rubygems/test_gem_package.rb2
-rw-r--r--test/rubygems/test_gem_package_old.rb1
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb1
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb1
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb1
-rw-r--r--test/rubygems/test_gem_package_task.rb1
-rw-r--r--test/rubygems/test_gem_platform.rb9
-rw-r--r--test/rubygems/test_gem_rdoc.rb3
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb16
-rw-r--r--test/rubygems/test_gem_request.rb8
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb2
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb3
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb3
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_parser.rb4
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_tokenizer.rb2
-rw-r--r--test/rubygems/test_gem_requirement.rb8
-rw-r--r--test/rubygems/test_gem_resolver.rb2
-rw-r--r--test/rubygems/test_gem_resolver_activation_request.rb1
-rw-r--r--test/rubygems/test_gem_resolver_api_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_api_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_composed_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_conflict.rb1
-rw-r--r--test/rubygems/test_gem_resolver_dependency_request.rb1
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_index_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_index_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_installed_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_lock_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_lock_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_requirement_list.rb1
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb3
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb1
-rw-r--r--test/rubygems/test_gem_security.rb3
-rw-r--r--test/rubygems/test_gem_security_policy.rb9
-rw-r--r--test/rubygems/test_gem_security_signer.rb3
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb3
-rw-r--r--test/rubygems/test_gem_source.rb1
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb1
-rw-r--r--test/rubygems/test_gem_source_git.rb1
-rw-r--r--test/rubygems/test_gem_source_installed.rb1
-rw-r--r--test/rubygems/test_gem_source_lock.rb1
-rw-r--r--test/rubygems/test_gem_source_vendor.rb1
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb1
-rw-r--r--test/rubygems/test_gem_specification.rb18
-rw-r--r--test/rubygems/test_gem_stream_ui.rb9
-rw-r--r--test/rubygems/test_gem_stub_specification.rb2
-rw-r--r--test/rubygems/test_gem_unsatisfiable_dependency_error.rb1
-rw-r--r--test/rubygems/test_gem_uri_formatter.rb1
-rw-r--r--test/rubygems/test_gem_util.rb1
-rw-r--r--test/rubygems/test_gem_validator.rb1
-rw-r--r--test/rubygems/test_gem_version.rb22
-rw-r--r--test/rubygems/test_gem_version_option.rb1
-rw-r--r--test/rubygems/test_remote_fetch_error.rb1
-rw-r--r--test/rubygems/test_require.rb2
100 files changed, 191 insertions, 187 deletions
diff --git a/test/rubygems/rubygems_plugin.rb b/test/rubygems/rubygems_plugin.rb
index 30a67789c6..7fac2ebec6 100644
--- a/test/rubygems/rubygems_plugin.rb
+++ b/test/rubygems/rubygems_plugin.rb
@@ -23,4 +23,3 @@ class Gem::Commands::InterruptCommand < Gem::Command
end
Gem::CommandManager.instance.register_command :interrupt
-
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index ae271d8c99..682fa84612 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -278,6 +278,41 @@ class TestGem < Gem::TestCase
assert_equal %w(a-1 b-2 c-1), loaded_spec_names
end
+ def test_activate_bin_path_gives_proper_error_for_bundler
+ bundler = util_spec 'bundler', '2' do |s|
+ s.executables = ['bundle']
+ end
+
+ install_specs bundler
+
+ File.open("Gemfile.lock", "w") do |f|
+ f.write <<-L.gsub(/ {8}/, "")
+ GEM
+ remote: https://rubygems.org/
+ specs:
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+
+ BUNDLED WITH
+ 9999
+ L
+ end
+
+ 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")
+ end
+
+ assert_includes e.message, "Could not find 'bundler' (9999) required by your #{File.expand_path("Gemfile.lock")}."
+ assert_includes e.message, "To update to the latest version installed on your system, run `bundle update --bundler`."
+ assert_includes e.message, "To install the missing version, run `gem install bundler:9999`"
+ refute_includes e.message, "can't find gem bundler (>= 0.a) with executable bundle"
+ end
+
def test_self_bin_path_no_exec_name
e = assert_raises ArgumentError do
Gem.bin_path 'a'
@@ -531,7 +566,7 @@ class TestGem < Gem::TestCase
assert File.directory?(util_cache_dir)
end
- unless win_platform? || Process.uid.zero? then # only for FS that support write protection
+ unless win_platform? || Process.uid.zero? # only for FS that support write protection
def test_self_ensure_gem_directories_write_protected
gemdir = File.join @tempdir, "egd"
FileUtils.rm_r gemdir rescue nil
@@ -958,7 +993,7 @@ class TestGem < Gem::TestCase
assert_equal Gem::Requirement.default, Gem.env_requirement('qux')
end
- def test_self_ruby_version_1_8_5
+ def test_self_ruby_version_with_patchlevel_less_ancient_rubies
util_set_RUBY_VERSION '1.8.5'
assert_equal Gem::Version.new('1.8.5'), Gem.ruby_version
@@ -966,7 +1001,7 @@ class TestGem < Gem::TestCase
util_restore_RUBY_VERSION
end
- def test_self_ruby_version_1_8_6p287
+ def test_self_ruby_version_with_release
util_set_RUBY_VERSION '1.8.6', 287
assert_equal Gem::Version.new('1.8.6.287'), Gem.ruby_version
@@ -974,10 +1009,34 @@ class TestGem < Gem::TestCase
util_restore_RUBY_VERSION
end
- def test_self_ruby_version_1_9_2dev_r23493
- util_set_RUBY_VERSION '1.9.2', -1, 23493
+ def test_self_ruby_version_with_non_mri_implementations
+ util_set_RUBY_VERSION '2.5.0', 0, 60928, 'jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11 [linux-x86_64]'
+
+ assert_equal Gem::Version.new('2.5.0'), Gem.ruby_version
+ ensure
+ util_restore_RUBY_VERSION
+ end
+
+ def test_self_ruby_version_with_prerelease
+ util_set_RUBY_VERSION '2.6.0', -1, 63539, 'ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]'
+
+ assert_equal Gem::Version.new('2.6.0.preview2'), Gem.ruby_version
+ ensure
+ util_restore_RUBY_VERSION
+ end
+
+ def test_self_ruby_version_with_non_mri_implementations_with_mri_prerelase_compatibility
+ util_set_RUBY_VERSION '2.6.0', -1, 63539, 'weirdjruby 9.2.0.0 (2.6.0preview2) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11 [linux-x86_64]', 'weirdjruby', '9.2.0.0'
+
+ assert_equal Gem::Version.new('2.6.0.preview2'), Gem.ruby_version
+ ensure
+ util_restore_RUBY_VERSION
+ end
+
+ def test_self_ruby_version_with_trunk
+ util_set_RUBY_VERSION '1.9.2', -1, 23493, 'ruby 1.9.2dev (2009-05-20 trunk 23493) [x86_64-linux]'
- assert_equal Gem::Version.new('1.9.2.dev.23493'), Gem.ruby_version
+ assert_equal Gem::Version.new('1.9.2.dev'), Gem.ruby_version
ensure
util_restore_RUBY_VERSION
end
@@ -1225,7 +1284,7 @@ class TestGem < Gem::TestCase
end
def test_self_user_home
- if ENV['HOME'] then
+ if ENV['HOME']
assert_equal ENV['HOME'], Gem.user_home
else
assert true, 'count this test'
@@ -1610,7 +1669,7 @@ class TestGem < Gem::TestCase
def test_default_gems_use_full_paths
begin
- if defined?(RUBY_ENGINE) then
+ if defined?(RUBY_ENGINE)
engine = RUBY_ENGINE
Object.send :remove_const, :RUBY_ENGINE
end
@@ -1623,7 +1682,7 @@ class TestGem < Gem::TestCase
end
begin
- if defined?(RUBY_ENGINE) then
+ if defined?(RUBY_ENGINE)
engine = RUBY_ENGINE
Object.send :remove_const, :RUBY_ENGINE
end
@@ -1813,13 +1872,13 @@ You may need to `gem install -g` to install missing gems
assert platform_defaults.is_a? Hash
end
- def ruby_install_name name
+ def ruby_install_name(name)
orig_RUBY_INSTALL_NAME = RbConfig::CONFIG['ruby_install_name']
RbConfig::CONFIG['ruby_install_name'] = name
yield
ensure
- if orig_RUBY_INSTALL_NAME then
+ if orig_RUBY_INSTALL_NAME
RbConfig::CONFIG['ruby_install_name'] = orig_RUBY_INSTALL_NAME
else
RbConfig::CONFIG.delete 'ruby_install_name'
diff --git a/test/rubygems/test_gem_command.rb b/test/rubygems/test_gem_command.rb
index 4442c6108e..8caa9c6e2e 100644
--- a/test/rubygems/test_gem_command.rb
+++ b/test/rubygems/test_gem_command.rb
@@ -251,4 +251,3 @@ ERROR: Possible alternatives: non_existent_with_hint
end
end
-
diff --git a/test/rubygems/test_gem_command_manager.rb b/test/rubygems/test_gem_command_manager.rb
index bb379427de..6ada96f1c1 100644
--- a/test/rubygems/test_gem_command_manager.rb
+++ b/test/rubygems/test_gem_command_manager.rb
@@ -267,4 +267,3 @@ class TestGemCommandManager < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb
index f7c92ebd7e..68b5724c61 100644
--- a/test/rubygems/test_gem_commands_build_command.rb
+++ b/test/rubygems/test_gem_commands_build_command.rb
@@ -286,7 +286,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
gem_path = File.join Gem.user_home, ".gem"
Dir.mkdir gem_path
- trust_dir = Gem::Security.trust_dir
+ Gem::Security.trust_dir
tmp_expired_cert_file = File.join gem_path, "gem-public_cert.pem"
File.write(tmp_expired_cert_file, File.read(EXPIRED_CERT_FILE))
diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb
index 97c081e110..d7381f14d0 100644
--- a/test/rubygems/test_gem_commands_cert_command.rb
+++ b/test/rubygems/test_gem_commands_cert_command.rb
@@ -2,7 +2,7 @@
require 'rubygems/test_case'
require 'rubygems/commands/cert_command'
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping `gem cert` tests. openssl not found.'
end
@@ -192,7 +192,6 @@ Added '/CN=alternate/DC=example'
test = (cert.not_after - cert.not_before).to_i / (24 * 60 * 60)
assert_equal(test, 26)
-
end
def test_execute_build_bad_passphrase_confirmation
@@ -795,4 +794,3 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
end
end if defined?(OpenSSL::SSL)
-
diff --git a/test/rubygems/test_gem_commands_check_command.rb b/test/rubygems/test_gem_commands_check_command.rb
index b220b4d36c..6a6033d35d 100644
--- a/test/rubygems/test_gem_commands_check_command.rb
+++ b/test/rubygems/test_gem_commands_check_command.rb
@@ -10,7 +10,7 @@ class TestGemCommandsCheckCommand < Gem::TestCase
@cmd = Gem::Commands::CheckCommand.new
end
- def gem name
+ def gem(name)
spec = quick_gem name do |gem|
gem.files = %W[lib/#{name}.rb Rakefile]
end
diff --git a/test/rubygems/test_gem_commands_cleanup_command.rb b/test/rubygems/test_gem_commands_cleanup_command.rb
index 7024e59fb9..fdcd71ed8a 100644
--- a/test/rubygems/test_gem_commands_cleanup_command.rb
+++ b/test/rubygems/test_gem_commands_cleanup_command.rb
@@ -264,4 +264,3 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
assert_path_exists d_2.gem_dir
end
end
-
diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb
index 65644f476b..a8d6efe794 100644
--- a/test/rubygems/test_gem_commands_contents_command.rb
+++ b/test/rubygems/test_gem_commands_contents_command.rb
@@ -10,7 +10,7 @@ class TestGemCommandsContentsCommand < Gem::TestCase
@cmd = Gem::Commands::ContentsCommand.new
end
- def gem name, version = 2
+ def gem(name, version = 2)
spec = quick_gem name, version do |gem|
gem.files = %W[lib/#{name}.rb Rakefile]
end
@@ -237,4 +237,3 @@ lib/foo.rb
end
end
-
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb
index 7433c33d63..25b759dd85 100644
--- a/test/rubygems/test_gem_commands_dependency_command.rb
+++ b/test/rubygems/test_gem_commands_dependency_command.rb
@@ -227,4 +227,3 @@ ERROR: Only reverse dependencies for local gems are supported.
end
end
-
diff --git a/test/rubygems/test_gem_commands_fetch_command.rb b/test/rubygems/test_gem_commands_fetch_command.rb
index 6858327ed3..9989f57bd7 100644
--- a/test/rubygems/test_gem_commands_fetch_command.rb
+++ b/test/rubygems/test_gem_commands_fetch_command.rb
@@ -124,4 +124,3 @@ class TestGemCommandsFetchCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_generate_index_command.rb b/test/rubygems/test_gem_commands_generate_index_command.rb
index 7e30a6dccf..b4276702f4 100644
--- a/test/rubygems/test_gem_commands_generate_index_command.rb
+++ b/test/rubygems/test_gem_commands_generate_index_command.rb
@@ -48,4 +48,3 @@ class TestGemCommandsGenerateIndexCommand < Gem::TestCase
end
end if ''.respond_to? :to_xs
-
diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb
index 6542cab599..55bc797b28 100644
--- a/test/rubygems/test_gem_commands_help_command.rb
+++ b/test/rubygems/test_gem_commands_help_command.rb
@@ -48,7 +48,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
assert_match(/\s+#{cmd}\s+\S+/, out)
end
- if defined?(OpenSSL::SSL) then
+ if defined?(OpenSSL::SSL)
assert_empty err
refute_match 'No command found for ', out
@@ -64,7 +64,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
end
end
- def util_gem *args
+ def util_gem(*args)
@cmd.options[:args] = args
use_ui @ui do
diff --git a/test/rubygems/test_gem_commands_lock_command.rb b/test/rubygems/test_gem_commands_lock_command.rb
index af1fce999c..a35ed081cb 100644
--- a/test/rubygems/test_gem_commands_lock_command.rb
+++ b/test/rubygems/test_gem_commands_lock_command.rb
@@ -66,4 +66,3 @@ gem 'd', '= 1'
end
end
-
diff --git a/test/rubygems/test_gem_commands_outdated_command.rb b/test/rubygems/test_gem_commands_outdated_command.rb
index 626b29057d..3b0220e84b 100644
--- a/test/rubygems/test_gem_commands_outdated_command.rb
+++ b/test/rubygems/test_gem_commands_outdated_command.rb
@@ -30,4 +30,3 @@ class TestGemCommandsOutdatedCommand < Gem::TestCase
assert_equal "", @ui.error
end
end
-
diff --git a/test/rubygems/test_gem_commands_owner_command.rb b/test/rubygems/test_gem_commands_owner_command.rb
index 3185074d98..1f9a2efbca 100644
--- a/test/rubygems/test_gem_commands_owner_command.rb
+++ b/test/rubygems/test_gem_commands_owner_command.rb
@@ -66,7 +66,6 @@ EOF
@cmd.show_owners("freewill")
end
end
-
end
diff --git a/test/rubygems/test_gem_commands_search_command.rb b/test/rubygems/test_gem_commands_search_command.rb
index 61caff1fc9..9187050c30 100644
--- a/test/rubygems/test_gem_commands_search_command.rb
+++ b/test/rubygems/test_gem_commands_search_command.rb
@@ -15,4 +15,3 @@ class TestGemCommandsSearchCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_server_command.rb b/test/rubygems/test_gem_commands_server_command.rb
index b61fc30e9b..d511ce0b7b 100644
--- a/test/rubygems/test_gem_commands_server_command.rb
+++ b/test/rubygems/test_gem_commands_server_command.rb
@@ -57,4 +57,3 @@ class TestGemCommandsServerCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index eabd023d96..d788c19ad5 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -66,7 +66,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
FileUtils.mkdir_p 'default/gems/bundler-audit-1.0.0'
end
- def gem_install name
+ def gem_install(name)
gem = util_spec name do |s|
s.executables = [name]
s.files = %W[bin/#{name}]
diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb
index 2cf86edd09..afcb8d6d99 100644
--- a/test/rubygems/test_gem_commands_signin_command.rb
+++ b/test/rubygems/test_gem_commands_signin_command.rb
@@ -74,7 +74,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
# Utility method to capture IO/UI within the block passed
- def util_capture ui_stub = nil, host = nil, api_key = nil
+ def util_capture(ui_stub = nil, host = nil, api_key = nil)
api_key ||= 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
response = [api_key, 200, 'OK']
email = 'you@example.com'
diff --git a/test/rubygems/test_gem_commands_sources_command.rb b/test/rubygems/test_gem_commands_sources_command.rb
index 54c0246150..ad92c26073 100644
--- a/test/rubygems/test_gem_commands_sources_command.rb
+++ b/test/rubygems/test_gem_commands_sources_command.rb
@@ -298,4 +298,3 @@ beta-gems.example.com is not a URI
end
end
-
diff --git a/test/rubygems/test_gem_commands_specification_command.rb b/test/rubygems/test_gem_commands_specification_command.rb
index 72e008b2cb..f56aa9777a 100644
--- a/test/rubygems/test_gem_commands_specification_command.rb
+++ b/test/rubygems/test_gem_commands_specification_command.rb
@@ -248,4 +248,3 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb
index f23f4c2461..f62f4277ed 100644
--- a/test/rubygems/test_gem_commands_uninstall_command.rb
+++ b/test/rubygems/test_gem_commands_uninstall_command.rb
@@ -83,7 +83,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
end
end
- if win_platform? then
+ if win_platform?
assert File.exist?(@executable)
else
assert File.symlink?(@executable)
@@ -318,4 +318,3 @@ WARNING: Use your OS package manager to uninstall vendor gems
assert_match %r!Error: unable to successfully uninstall '#{@spec.name}'!, @ui.error
end
end
-
diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb
index 4fde83e524..7d96caaf57 100644
--- a/test/rubygems/test_gem_commands_unpack_command.rb
+++ b/test/rubygems/test_gem_commands_unpack_command.rb
@@ -223,4 +223,3 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_which_command.rb b/test/rubygems/test_gem_commands_which_command.rb
index 0c2b177273..0d63bb9b37 100644
--- a/test/rubygems/test_gem_commands_which_command.rb
+++ b/test/rubygems/test_gem_commands_which_command.rb
@@ -84,4 +84,3 @@ class TestGemCommandsWhichCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_commands_yank_command.rb b/test/rubygems/test_gem_commands_yank_command.rb
index 70aa2263a6..d30c386aa6 100644
--- a/test/rubygems/test_gem_commands_yank_command.rb
+++ b/test/rubygems/test_gem_commands_yank_command.rb
@@ -97,4 +97,3 @@ class TestGemCommandsYankCommand < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb
index 5749905b5a..192699aaba 100644
--- a/test/rubygems/test_gem_config_file.rb
+++ b/test/rubygems/test_gem_config_file.rb
@@ -344,7 +344,7 @@ if you believe they were disclosed to a third party.
assert_equal expected, YAML.load_file(@cfg.credentials_path)
- unless win_platform? then
+ unless win_platform?
stat = File.stat @cfg.credentials_path
assert_equal 0600, stat.mode & 0600
@@ -490,4 +490,3 @@ if you believe they were disclosed to a third party.
assert_equal(true, @cfg.disable_default_gem_server)
end
end
-
diff --git a/test/rubygems/test_gem_dependency.rb b/test/rubygems/test_gem_dependency.rb
index d7eec3c090..daeb8f625c 100644
--- a/test/rubygems/test_gem_dependency.rb
+++ b/test/rubygems/test_gem_dependency.rb
@@ -358,7 +358,7 @@ class TestGemDependency < Gem::TestCase
dep.to_specs
end
- assert_match "Could not find 'bundler' (3.5) required by reason.\nTo update to the lastest version installed on your system, run `bundle update --bundler`.\nTo install the missing version, run `gem install bundler:3.5`\n", e.message
+ assert_match "Could not find 'bundler' (3.5) required by reason.\nTo update to the latest version installed on your system, run `bundle update --bundler`.\nTo install the missing version, run `gem install bundler:3.5`\n", e.message
end
Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["2.0.0.pre.1", "reason"]) do
@@ -387,4 +387,3 @@ class TestGemDependency < Gem::TestCase
end
-
diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb
index 503bedf719..74b7a6a83e 100644
--- a/test/rubygems/test_gem_dependency_installer.rb
+++ b/test/rubygems/test_gem_dependency_installer.rb
@@ -897,7 +897,7 @@ class TestGemDependencyInstaller < Gem::TestCase
assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map { |s| s.full_name }
end
- if defined? OpenSSL then
+ if defined? OpenSSL
def test_install_security_policy
util_setup_gems
@@ -922,7 +922,7 @@ class TestGemDependencyInstaller < Gem::TestCase
end
# Wrappers don't work on mswin
- unless win_platform? then
+ unless win_platform?
def test_install_no_wrappers
util_setup_gems
@@ -1073,7 +1073,6 @@ class TestGemDependencyInstaller < Gem::TestCase
assert_equal 'a-1', remote.spec.full_name, 'remote spec'
assert_equal Gem::Source.new(@gem_repo), remote.source, 'remote path'
-
end
def test_find_gems_with_sources_prerelease
diff --git a/test/rubygems/test_gem_dependency_list.rb b/test/rubygems/test_gem_dependency_list.rb
index 7ba91be95f..9bd6ceb6f3 100644
--- a/test/rubygems/test_gem_dependency_list.rb
+++ b/test/rubygems/test_gem_dependency_list.rb
@@ -257,4 +257,3 @@ class TestGemDependencyList < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_dependency_resolution_error.rb b/test/rubygems/test_gem_dependency_resolution_error.rb
index b9625a3c02..cf4663650e 100644
--- a/test/rubygems/test_gem_dependency_resolution_error.rb
+++ b/test/rubygems/test_gem_dependency_resolution_error.rb
@@ -26,4 +26,3 @@ class TestGemDependencyResolutionError < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_doctor.rb b/test/rubygems/test_gem_doctor.rb
index 8db65d70ce..a0e3a18d7f 100644
--- a/test/rubygems/test_gem_doctor.rb
+++ b/test/rubygems/test_gem_doctor.rb
@@ -4,7 +4,7 @@ require 'rubygems/doctor'
class TestGemDoctor < Gem::TestCase
- def gem name
+ def gem(name)
spec = quick_gem name do |gem|
gem.files = %W[lib/#{name}.rb Rakefile]
end
@@ -166,4 +166,3 @@ This directory does not appear to be a RubyGems repository, skipping
end
end
-
diff --git a/test/rubygems/test_gem_ext_ext_conf_builder.rb b/test/rubygems/test_gem_ext_ext_conf_builder.rb
index bc87790183..6decb29a99 100644
--- a/test/rubygems/test_gem_ext_ext_conf_builder.rb
+++ b/test/rubygems/test_gem_ext_ext_conf_builder.rb
@@ -35,7 +35,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
end
assert_match(/^current directory:/, output[0])
- assert_match(/^#{Regexp.quote(Gem.ruby.shellescape)}.* extconf.rb/, output[1])
+ assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1])
assert_equal "creating Makefile\n", output[2]
assert_match(/^current directory:/, output[3])
assert_contains_make_command 'clean', output[4]
@@ -109,7 +109,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
assert_equal 'extconf failed, exit code 1', error.message
- assert_match(/^#{Regexp.quote(Gem.ruby.shellescape)}.* extconf.rb/, output[1])
+ assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1])
assert_match(File.join(@dest_path, 'mkmf.log'), output[4])
assert_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
@@ -216,14 +216,14 @@ end
assert_equal 'Makefile not found', error.message
end
- def configure_args args = nil
+ def configure_args(args = nil)
configure_args = RbConfig::CONFIG['configure_args']
RbConfig::CONFIG['configure_args'] = args if args
yield
ensure
- if configure_args then
+ if configure_args
RbConfig::CONFIG['configure_args'] = configure_args
else
RbConfig::CONFIG.delete 'configure_args'
diff --git a/test/rubygems/test_gem_ext_rake_builder.rb b/test/rubygems/test_gem_ext_rake_builder.rb
index b2dd7392c8..6b647293a8 100644
--- a/test/rubygems/test_gem_ext_rake_builder.rb
+++ b/test/rubygems/test_gem_ext_rake_builder.rb
@@ -25,8 +25,8 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
refute_match %r%^rake failed:%, output
- assert_match %r%^#{Regexp.escape @@ruby.shellescape} mkrf_conf\.rb%, output
- assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape}%, output
+ assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
+ assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output
end
end
@@ -46,8 +46,8 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
refute_match %r%^rake failed:%, output
- assert_match %r%^#{Regexp.escape @@ruby.shellescape} mkrf_conf\.rb%, output
- assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape}%, output
+ assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
+ assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output
end
end
@@ -62,7 +62,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
refute_match %r%^rake failed:%, output
- assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape} test1 test2%, output
+ assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2%, output
end
end
diff --git a/test/rubygems/test_gem_gem_runner.rb b/test/rubygems/test_gem_gem_runner.rb
index d68ac4da81..7c771de9e5 100644
--- a/test/rubygems/test_gem_gem_runner.rb
+++ b/test/rubygems/test_gem_gem_runner.rb
@@ -66,4 +66,3 @@ class TestGemGemRunner < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb
index 90f9142171..f0d2428391 100644
--- a/test/rubygems/test_gem_gemcutter_utilities.rb
+++ b/test/rubygems/test_gem_gemcutter_utilities.rb
@@ -187,7 +187,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert_match %r{Access Denied.}, @sign_in_ui.output
end
- def util_sign_in response, host = nil, args = []
+ def util_sign_in(response, host = nil, args = [])
email = 'you@example.com'
password = 'secret'
@@ -204,7 +204,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
@sign_in_ui = Gem::MockGemUi.new "#{email}\n#{password}\n"
use_ui @sign_in_ui do
- if args.length > 0 then
+ if args.length > 0
@cmd.sign_in(*args)
else
@cmd.sign_in
diff --git a/test/rubygems/test_gem_impossible_dependencies_error.rb b/test/rubygems/test_gem_impossible_dependencies_error.rb
index 027c99a9e5..8a0f8d6196 100644
--- a/test/rubygems/test_gem_impossible_dependencies_error.rb
+++ b/test/rubygems/test_gem_impossible_dependencies_error.rb
@@ -59,4 +59,3 @@ rye-0.9.8 requires net-ssh (>= 2.0.13) but it conflicted:
end
end
-
diff --git a/test/rubygems/test_gem_indexer.rb b/test/rubygems/test_gem_indexer.rb
index 5a9075e676..9f27744d48 100644
--- a/test/rubygems/test_gem_indexer.rb
+++ b/test/rubygems/test_gem_indexer.rb
@@ -2,7 +2,7 @@
require 'rubygems/test_case'
require 'rubygems/indexer'
-unless defined?(Builder::XChar) then
+unless defined?(Builder::XChar)
warn "Gem::Indexer tests are being skipped. Install builder gem." if $VERBOSE
end
@@ -363,4 +363,3 @@ class TestGemIndexer < Gem::TestCase
end
end if defined?(Builder::XChar)
-
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index b8e4b1e2e5..4004df2a39 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -56,7 +56,7 @@ version = \">= 0.a\"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY")
- if str =~ /\\A_(.*)_\\z/ and Gem::Version.correct?($1) then
+ if str =~ /\\A_(.*)_\\z/ and Gem::Version.correct?($1)
version = $1
ARGV.shift
end
@@ -121,7 +121,7 @@ end
ensure
Object.const_set :RUBY_FRAMEWORK_VERSION, orig_RUBY_FRAMEWORK_VERSION if
orig_RUBY_FRAMEWORK_VERSION
- if orig_bindir then
+ if orig_bindir
RbConfig::CONFIG['bindir'] = orig_bindir
else
RbConfig::CONFIG.delete 'bindir'
@@ -250,7 +250,7 @@ gem 'other', version
expected = @installer.bin_dir
- if Gem.win_platform? then
+ if Gem.win_platform?
expected = expected.downcase.gsub(File::SEPARATOR, File::ALT_SEPARATOR)
end
@@ -488,7 +488,7 @@ gem 'other', version
real_exec = File.join @spec.gem_dir, 'bin', 'executable'
# fake --no-wrappers for previous install
- unless Gem.win_platform? then
+ unless Gem.win_platform?
FileUtils.mkdir_p File.dirname(installed_exec)
FileUtils.ln_s real_exec, installed_exec
end
@@ -692,7 +692,7 @@ gem 'other', version
@installer.generate_bin
- default_shebang = Gem.ruby.shellescape
+ default_shebang = Gem.ruby
shebang_line = open("#{@gemhome}/bin/executable") { |f| f.readlines.first }
assert_match(/\A#!/, shebang_line)
assert_match(/#{default_shebang}/, shebang_line)
@@ -965,7 +965,7 @@ gem 'other', version
def test_install_force
use_ui @ui do
- installer = Gem::Installer.at old_ruby_required, :force => true
+ installer = Gem::Installer.at old_ruby_required('= 1.4.6'), :force => true
installer.install
end
@@ -1380,16 +1380,32 @@ gem 'other', version
def test_pre_install_checks_ruby_version
use_ui @ui do
- installer = Gem::Installer.at old_ruby_required
+ installer = Gem::Installer.at old_ruby_required('= 1.4.6')
e = assert_raises Gem::RuntimeRequirementNotMetError do
installer.pre_install_checks
end
- rv = Gem.ruby_api_version
+ rv = Gem.ruby_version
assert_equal "old_ruby_required requires Ruby version = 1.4.6. The current ruby version is #{rv}.",
e.message
end
end
+ def test_pre_install_checks_ruby_version_with_prereleases
+ util_set_RUBY_VERSION '2.6.0', -1, '63539', 'ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]'
+
+ installer = Gem::Installer.at old_ruby_required('>= 2.6.0.preview2')
+ assert installer.pre_install_checks
+
+ installer = Gem::Installer.at old_ruby_required('> 2.6.0.preview2')
+ e = assert_raises Gem::RuntimeRequirementNotMetError do
+ assert installer.pre_install_checks
+ end
+ assert_equal "old_ruby_required requires Ruby version > 2.6.0.preview2. The current ruby version is 2.6.0.preview2.",
+ e.message
+ ensure
+ util_restore_RUBY_VERSION
+ end
+
def test_pre_install_checks_wrong_rubygems_version
spec = util_spec 'old_rubygems_required', '1' do |s|
s.required_rubygems_version = '< 0'
@@ -1415,7 +1431,7 @@ gem 'other', version
def spec.full_name # so the spec is buildable
"malicious-1"
end
- def spec.validate packaging, strict; end
+ def spec.validate(packaging, strict); end
util_build_gem spec
@@ -1720,9 +1736,9 @@ gem 'other', version
assert_equal ['bin/executable'], default_spec.files
end
- def old_ruby_required
+ def old_ruby_required(requirement)
spec = util_spec 'old_ruby_required', '1' do |s|
- s.required_ruby_version = '= 1.4.6'
+ s.required_ruby_version = requirement
end
util_build_gem spec
@@ -1737,7 +1753,7 @@ gem 'other', version
@installer = util_installer @spec, @gemhome
end
- def util_conflict_executable wrappers
+ def util_conflict_executable(wrappers)
conflict = quick_gem 'conflict' do |spec|
util_make_exec spec
end
diff --git a/test/rubygems/test_gem_local_remote_options.rb b/test/rubygems/test_gem_local_remote_options.rb
index a51182b11c..6c21300c2a 100644
--- a/test/rubygems/test_gem_local_remote_options.rb
+++ b/test/rubygems/test_gem_local_remote_options.rb
@@ -132,4 +132,3 @@ class TestGemLocalRemoteOptions < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_name_tuple.rb b/test/rubygems/test_gem_name_tuple.rb
index 9bc2924cf6..5331e1cdbb 100644
--- a/test/rubygems/test_gem_name_tuple.rb
+++ b/test/rubygems/test_gem_name_tuple.rb
@@ -42,4 +42,3 @@ class TestGemNameTuple < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb
index a53cda1274..813a829403 100644
--- a/test/rubygems/test_gem_package.rb
+++ b/test/rubygems/test_gem_package.rb
@@ -94,7 +94,7 @@ class TestGemPackage < Gem::Package::TarTestCase
}
}
- if defined?(OpenSSL::Digest) then
+ if defined?(OpenSSL::Digest)
expected['SHA256'] = {
'metadata.gz' => metadata_sha256,
'data.tar.gz' => Digest::SHA256.hexdigest(tar),
diff --git a/test/rubygems/test_gem_package_old.rb b/test/rubygems/test_gem_package_old.rb
index 604981b3c1..ab7934dde5 100644
--- a/test/rubygems/test_gem_package_old.rb
+++ b/test/rubygems/test_gem_package_old.rb
@@ -87,4 +87,3 @@ class TestGemPackageOld < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_package_tar_header.rb b/test/rubygems/test_gem_package_tar_header.rb
index 2dbfffa14c..5e804bb418 100644
--- a/test/rubygems/test_gem_package_tar_header.rb
+++ b/test/rubygems/test_gem_package_tar_header.rb
@@ -165,4 +165,3 @@ group\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
end
end
-
diff --git a/test/rubygems/test_gem_package_tar_reader.rb b/test/rubygems/test_gem_package_tar_reader.rb
index e8a902c311..489685d09d 100644
--- a/test/rubygems/test_gem_package_tar_reader.rb
+++ b/test/rubygems/test_gem_package_tar_reader.rb
@@ -87,4 +87,3 @@ class TestGemPackageTarReader < Gem::Package::TarTestCase
end
end
-
diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb
index 2808d87718..408db07de7 100644
--- a/test/rubygems/test_gem_package_tar_writer.rb
+++ b/test/rubygems/test_gem_package_tar_writer.rb
@@ -136,7 +136,6 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
assert_equal 2048, @io.pos
end
-
end
def test_add_file_signer_empty
diff --git a/test/rubygems/test_gem_package_task.rb b/test/rubygems/test_gem_package_task.rb
index f69ee36bd3..2794ab81fb 100644
--- a/test/rubygems/test_gem_package_task.rb
+++ b/test/rubygems/test_gem_package_task.rb
@@ -81,4 +81,3 @@ class TestGemPackageTask < Gem::TestCase
end
end if defined?(Rake::PackageTask)
-
diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb
index c9abd08868..fc8b7030fb 100644
--- a/test/rubygems/test_gem_platform.rb
+++ b/test/rubygems/test_gem_platform.rb
@@ -117,7 +117,7 @@ class TestGemPlatform < Gem::TestCase
assert_equal expected, platform.to_a, 'i386-mswin32 VC6'
ensure
- if orig_RUBY_SO_NAME then
+ if orig_RUBY_SO_NAME
RbConfig::CONFIG['RUBY_SO_NAME'] = orig_RUBY_SO_NAME
else
RbConfig::CONFIG.delete 'RUBY_SO_NAME'
@@ -145,7 +145,7 @@ class TestGemPlatform < Gem::TestCase
end
def test_to_s
- if win_platform? then
+ if win_platform?
assert_equal 'x86-mswin32-60', Gem::Platform.local.to_s
else
assert_equal 'x86-darwin-8', Gem::Platform.local.to_s
@@ -297,12 +297,11 @@ class TestGemPlatform < Gem::TestCase
assert_local_match 'sparc-solaris2.8-mq5.3'
end
- def assert_local_match name
+ def assert_local_match(name)
assert_match Gem::Platform.local, name
end
- def refute_local_match name
+ def refute_local_match(name)
refute_match Gem::Platform.local, name
end
end
-
diff --git a/test/rubygems/test_gem_rdoc.rb b/test/rubygems/test_gem_rdoc.rb
index 0355883cb3..073578527d 100644
--- a/test/rubygems/test_gem_rdoc.rb
+++ b/test/rubygems/test_gem_rdoc.rb
@@ -49,7 +49,7 @@ class TestGemRDoc < Gem::TestCase
end
def test_initialize
- if rdoc_4? then
+ if rdoc_4?
refute @hook.generate_rdoc
else
assert @hook.generate_rdoc
@@ -269,4 +269,3 @@ class TestGemRDoc < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 0c4367d417..6561ba6bda 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -9,7 +9,7 @@ rescue LoadError => e
e.message =~ / -- openssl$/
end
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping Gem::Request tests. openssl not found.'
end
@@ -211,20 +211,20 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
refute_path_exists path
end
- def util_fuck_with_fetcher data, blow = false
+ def util_fuck_with_fetcher(data, blow = false)
fetcher = Gem::RemoteFetcher.fetcher
fetcher.instance_variable_set :@test_data, data
- unless blow then
- def fetcher.fetch_path arg, *rest
+ unless blow
+ def fetcher.fetch_path(arg, *rest)
@test_arg = arg
@test_data
end
else
- def fetcher.fetch_path arg, *rest
+ def fetcher.fetch_path(arg, *rest)
# OMG I'm such an ass
class << self; remove_method :fetch_path; end
- def self.fetch_path arg, *rest
+ def self.fetch_path(arg, *rest)
@test_arg = arg
@test_data
end
@@ -424,7 +424,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
util_setup_spec_fetcher @a1, @a2
@fetcher.instance_variable_set :@a1, @a1
@fetcher.instance_variable_set :@a2, @a2
- def @fetcher.fetch_path uri, mtime = nil, head = false
+ def @fetcher.fetch_path(uri, mtime = nil, head = false)
case uri.request_uri
when /#{@a1.spec_name}/ then
Gem.deflate Marshal.dump @a1
@@ -570,7 +570,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
def fetcher.request(uri, request_class, last_modified = nil)
url = 'http://gems.example.com/redirect'
- unless defined? @requested then
+ unless defined? @requested
@requested = true
res = Net::HTTPMovedPermanently.new nil, 301, nil
res.add_field 'Location', url
diff --git a/test/rubygems/test_gem_request.rb b/test/rubygems/test_gem_request.rb
index 1409acb23b..8b475fae42 100644
--- a/test/rubygems/test_gem_request.rb
+++ b/test/rubygems/test_gem_request.rb
@@ -4,7 +4,7 @@ require 'rubygems/request'
require 'ostruct'
require 'base64'
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping Gem::Request tests. openssl not found.'
end
@@ -17,7 +17,7 @@ class TestGemRequest < Gem::TestCase
PUBLIC_CERT_FILE = cert_path 'public'
SSL_CERT = load_cert 'ssl'
- def make_request uri, request_class, last_modified, proxy
+ def make_request(uri, request_class, last_modified, proxy)
Gem::Request.create_with_proxy uri, request_class, last_modified, proxy
end
@@ -465,7 +465,7 @@ ERROR: Certificate is an invalid CA certificate
@orig_RUBY_REVISION = RUBY_REVISION if defined? RUBY_REVISION
end
- def util_stub_net_http hash
+ def util_stub_net_http(hash)
old_client = Gem::Request::ConnectionPools.client
conn = Conn.new OpenStruct.new(hash)
Gem::Request::ConnectionPools.client = conn
@@ -477,7 +477,7 @@ ERROR: Certificate is an invalid CA certificate
class Conn
attr_accessor :payload
- def new *args; self; end
+ def new(*args); self; end
def use_ssl=(bool); end
def verify_callback=(setting); end
def verify_mode=(setting); end
diff --git a/test/rubygems/test_gem_request_connection_pools.rb b/test/rubygems/test_gem_request_connection_pools.rb
index ecd1e9861f..eb48ba45d2 100644
--- a/test/rubygems/test_gem_request_connection_pools.rb
+++ b/test/rubygems/test_gem_request_connection_pools.rb
@@ -5,7 +5,7 @@ require 'timeout'
class TestGemRequestConnectionPool < Gem::TestCase
class FakeHttp
- def initialize *args
+ def initialize(*args)
end
def start
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 71a095b07f..320fdcb604 100644
--- a/test/rubygems/test_gem_request_set_gem_dependency_api.rb
+++ b/test/rubygems/test_gem_request_set_gem_dependency_api.rb
@@ -19,7 +19,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
@gda.instance_variable_set :@vendor_set, @vendor_set
end
- def with_engine_version name, version
+ def with_engine_version(name, version)
engine = RUBY_ENGINE if Object.const_defined? :RUBY_ENGINE
engine_version_const = "#{Gem.ruby_engine.upcase}_VERSION"
engine_version = Object.const_get engine_version_const
@@ -824,4 +824,3 @@ end
end
end
-
diff --git a/test/rubygems/test_gem_request_set_lockfile.rb b/test/rubygems/test_gem_request_set_lockfile.rb
index 7460b7efad..9ac691ebdd 100644
--- a/test/rubygems/test_gem_request_set_lockfile.rb
+++ b/test/rubygems/test_gem_request_set_lockfile.rb
@@ -21,14 +21,13 @@ class TestGemRequestSetLockfile < Gem::TestCase
@set.instance_variable_set :@vendor_set, @vendor_set
@gem_deps_file = 'gem.deps.rb'
-
end
def lockfile
Gem::RequestSet::Lockfile.build @set, @gem_deps_file
end
- def write_lockfile lockfile
+ def write_lockfile(lockfile)
@lock_file = File.expand_path "#{@gem_deps_file}.lock"
File.open @lock_file, 'w' do |io|
diff --git a/test/rubygems/test_gem_request_set_lockfile_parser.rb b/test/rubygems/test_gem_request_set_lockfile_parser.rb
index 296cf5f4a0..27ee519ea7 100644
--- a/test/rubygems/test_gem_request_set_lockfile_parser.rb
+++ b/test/rubygems/test_gem_request_set_lockfile_parser.rb
@@ -530,13 +530,13 @@ DEPENDENCIES
refute lockfile_set
end
- def write_lockfile lockfile
+ def write_lockfile(lockfile)
File.open @lock_file, 'w' do |io|
io.write lockfile
end
end
- def parse_lockfile set, platforms
+ def parse_lockfile(set, platforms)
tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file @lock_file
parser = tokenizer.make_parser set, platforms
parser.parse
diff --git a/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb b/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb
index f4aba6d94a..48e66cf56a 100644
--- a/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb
+++ b/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb
@@ -294,7 +294,7 @@ GEM
assert_equal :token, parser.get
end
- def write_lockfile lockfile
+ def write_lockfile(lockfile)
File.open @lock_file, 'w' do |io|
io.write lockfile
end
diff --git a/test/rubygems/test_gem_requirement.rb b/test/rubygems/test_gem_requirement.rb
index 7bca00e58b..1564ffb0ed 100644
--- a/test/rubygems/test_gem_requirement.rb
+++ b/test/rubygems/test_gem_requirement.rb
@@ -387,26 +387,26 @@ class TestGemRequirement < Gem::TestCase
# Assert that two requirements are equal. Handles Gem::Requirements,
# strings, arrays, numbers, and versions.
- def assert_requirement_equal expected, actual
+ def assert_requirement_equal(expected, actual)
assert_equal req(expected), req(actual)
end
# Assert that +version+ satisfies +requirement+.
- def assert_satisfied_by version, requirement
+ def assert_satisfied_by(version, requirement)
assert req(requirement).satisfied_by?(v(version)),
"#{requirement} is satisfied by #{version}"
end
# Refute the assumption that two requirements are equal.
- def refute_requirement_equal unexpected, actual
+ def refute_requirement_equal(unexpected, actual)
refute_equal req(unexpected), req(actual)
end
# Refute the assumption that +version+ satisfies +requirement+.
- def refute_satisfied_by version, requirement
+ def refute_satisfied_by(version, requirement)
refute req(requirement).satisfied_by?(v(version)),
"#{requirement} is not satisfied by #{version}"
end
diff --git a/test/rubygems/test_gem_resolver.rb b/test/rubygems/test_gem_resolver.rb
index 99cb77afaf..fa1c595afd 100644
--- a/test/rubygems/test_gem_resolver.rb
+++ b/test/rubygems/test_gem_resolver.rb
@@ -23,7 +23,7 @@ class TestGemResolver < Gem::TestCase
StaticSet.new(specs)
end
- def assert_resolves_to expected, resolver
+ def assert_resolves_to(expected, resolver)
actual = resolver.resolve
exp = expected.sort_by { |s| s.full_name }
diff --git a/test/rubygems/test_gem_resolver_activation_request.rb b/test/rubygems/test_gem_resolver_activation_request.rb
index ee1b38887a..5d5de1a2d5 100644
--- a/test/rubygems/test_gem_resolver_activation_request.rb
+++ b/test/rubygems/test_gem_resolver_activation_request.rb
@@ -71,4 +71,3 @@ class TestGemResolverActivationRequest < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_api_set.rb b/test/rubygems/test_gem_resolver_api_set.rb
index 5746614039..f6b3e49c74 100644
--- a/test/rubygems/test_gem_resolver_api_set.rb
+++ b/test/rubygems/test_gem_resolver_api_set.rb
@@ -206,4 +206,3 @@ class TestGemResolverAPISet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_api_specification.rb b/test/rubygems/test_gem_resolver_api_specification.rb
index 8c17d42386..87ff901320 100644
--- a/test/rubygems/test_gem_resolver_api_specification.rb
+++ b/test/rubygems/test_gem_resolver_api_specification.rb
@@ -166,4 +166,3 @@ class TestGemResolverAPISpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_best_set.rb b/test/rubygems/test_gem_resolver_best_set.rb
index 556f0e8349..dc6c9b4c44 100644
--- a/test/rubygems/test_gem_resolver_best_set.rb
+++ b/test/rubygems/test_gem_resolver_best_set.rb
@@ -135,4 +135,3 @@ class TestGemResolverBestSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_composed_set.rb b/test/rubygems/test_gem_resolver_composed_set.rb
index f1c2da0454..0e745433a9 100644
--- a/test/rubygems/test_gem_resolver_composed_set.rb
+++ b/test/rubygems/test_gem_resolver_composed_set.rb
@@ -43,4 +43,3 @@ class TestGemResolverComposedSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_conflict.rb b/test/rubygems/test_gem_resolver_conflict.rb
index d4b3455570..a078136510 100644
--- a/test/rubygems/test_gem_resolver_conflict.rb
+++ b/test/rubygems/test_gem_resolver_conflict.rb
@@ -85,4 +85,3 @@ class TestGemResolverConflict < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_dependency_request.rb b/test/rubygems/test_gem_resolver_dependency_request.rb
index ac8f48a526..51f0be9dcd 100644
--- a/test/rubygems/test_gem_resolver_dependency_request.rb
+++ b/test/rubygems/test_gem_resolver_dependency_request.rb
@@ -82,4 +82,3 @@ class TestGemResolverDependencyRequest < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_git_set.rb b/test/rubygems/test_gem_resolver_git_set.rb
index b87a80d44e..f38859c8b4 100644
--- a/test/rubygems/test_gem_resolver_git_set.rb
+++ b/test/rubygems/test_gem_resolver_git_set.rb
@@ -187,4 +187,3 @@ class TestGemResolverGitSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_git_specification.rb b/test/rubygems/test_gem_resolver_git_specification.rb
index 211757eb20..3a9bb6a802 100644
--- a/test/rubygems/test_gem_resolver_git_specification.rb
+++ b/test/rubygems/test_gem_resolver_git_specification.rb
@@ -111,4 +111,3 @@ class TestGemResolverGitSpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_index_set.rb b/test/rubygems/test_gem_resolver_index_set.rb
index 0f18572904..d9a30d0f58 100644
--- a/test/rubygems/test_gem_resolver_index_set.rb
+++ b/test/rubygems/test_gem_resolver_index_set.rb
@@ -87,4 +87,3 @@ class TestGemResolverIndexSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_index_specification.rb b/test/rubygems/test_gem_resolver_index_specification.rb
index 6565892750..3768dd9bae 100644
--- a/test/rubygems/test_gem_resolver_index_specification.rb
+++ b/test/rubygems/test_gem_resolver_index_specification.rb
@@ -87,4 +87,3 @@ class TestGemResolverIndexSpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_installed_specification.rb b/test/rubygems/test_gem_resolver_installed_specification.rb
index 1dfbb054f3..2b54fbc629 100644
--- a/test/rubygems/test_gem_resolver_installed_specification.rb
+++ b/test/rubygems/test_gem_resolver_installed_specification.rb
@@ -47,4 +47,3 @@ class TestGemResolverInstalledSpecification < Gem::TestCase
end
-
diff --git a/test/rubygems/test_gem_resolver_installer_set.rb b/test/rubygems/test_gem_resolver_installer_set.rb
index 9644e0a7a9..50350e2d3d 100644
--- a/test/rubygems/test_gem_resolver_installer_set.rb
+++ b/test/rubygems/test_gem_resolver_installer_set.rb
@@ -255,4 +255,3 @@ class TestGemResolverInstallerSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_local_specification.rb b/test/rubygems/test_gem_resolver_local_specification.rb
index d04d1ec8b3..82598f5188 100644
--- a/test/rubygems/test_gem_resolver_local_specification.rb
+++ b/test/rubygems/test_gem_resolver_local_specification.rb
@@ -43,4 +43,3 @@ class TestGemResolverLocalSpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_lock_set.rb b/test/rubygems/test_gem_resolver_lock_set.rb
index 969f13fa8b..d5258477d7 100644
--- a/test/rubygems/test_gem_resolver_lock_set.rb
+++ b/test/rubygems/test_gem_resolver_lock_set.rb
@@ -61,4 +61,3 @@ class TestGemResolverLockSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_lock_specification.rb b/test/rubygems/test_gem_resolver_lock_specification.rb
index 3105ad65b3..7b9b0ac8f7 100644
--- a/test/rubygems/test_gem_resolver_lock_specification.rb
+++ b/test/rubygems/test_gem_resolver_lock_specification.rb
@@ -97,4 +97,3 @@ class TestGemResolverLockSpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_requirement_list.rb b/test/rubygems/test_gem_resolver_requirement_list.rb
index 6361dc32e6..4cbb939199 100644
--- a/test/rubygems/test_gem_resolver_requirement_list.rb
+++ b/test/rubygems/test_gem_resolver_requirement_list.rb
@@ -18,4 +18,3 @@ class TestGemResolverRequirementList < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_specification.rb b/test/rubygems/test_gem_resolver_specification.rb
index 50ac7ec3a1..c184cea352 100644
--- a/test/rubygems/test_gem_resolver_specification.rb
+++ b/test/rubygems/test_gem_resolver_specification.rb
@@ -7,7 +7,7 @@ class TestGemResolverSpecification < Gem::TestCase
attr_writer :source
attr_reader :spec
- def initialize spec
+ def initialize(spec)
super()
@spec = spec
@@ -62,4 +62,3 @@ class TestGemResolverSpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_vendor_set.rb b/test/rubygems/test_gem_resolver_vendor_set.rb
index c5b9ad019f..3fc79fec16 100644
--- a/test/rubygems/test_gem_resolver_vendor_set.rb
+++ b/test/rubygems/test_gem_resolver_vendor_set.rb
@@ -81,4 +81,3 @@ class TestGemResolverVendorSet < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_resolver_vendor_specification.rb b/test/rubygems/test_gem_resolver_vendor_specification.rb
index 1f9337c3fa..315ce05539 100644
--- a/test/rubygems/test_gem_resolver_vendor_specification.rb
+++ b/test/rubygems/test_gem_resolver_vendor_specification.rb
@@ -81,4 +81,3 @@ class TestGemResolverVendorSpecification < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_security.rb b/test/rubygems/test_gem_security.rb
index 962f858b5b..b5a887abb8 100644
--- a/test/rubygems/test_gem_security.rb
+++ b/test/rubygems/test_gem_security.rb
@@ -2,7 +2,7 @@
require 'rubygems/test_case'
require 'rubygems/security'
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping Gem::Security tests. openssl not found.'
end
@@ -308,4 +308,3 @@ class TestGemSecurity < Gem::TestCase
end
end if defined?(OpenSSL::SSL)
-
diff --git a/test/rubygems/test_gem_security_policy.rb b/test/rubygems/test_gem_security_policy.rb
index 6cd032baf5..0012d188cf 100644
--- a/test/rubygems/test_gem_security_policy.rb
+++ b/test/rubygems/test_gem_security_policy.rb
@@ -3,7 +3,7 @@
require 'rubygems/test_case'
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping Gem::Security::Policy tests. openssl not found.'
end
@@ -518,17 +518,17 @@ class TestGemSecurityPolicy < Gem::TestCase
end
end
- def digest data
+ def digest(data)
digester = @digest.new
digester << data
digester
end
- def sign data, key = PRIVATE_KEY
+ def sign(data, key = PRIVATE_KEY)
key.sign @digest.new, data.digest
end
- def dummy_signatures key = PRIVATE_KEY
+ def dummy_signatures(key = PRIVATE_KEY)
data = digest 'hello'
digests = { Gem::Security::DIGEST_NAME => { 0 => data } }
@@ -538,4 +538,3 @@ class TestGemSecurityPolicy < Gem::TestCase
end
end if defined?(OpenSSL::SSL)
-
diff --git a/test/rubygems/test_gem_security_signer.rb b/test/rubygems/test_gem_security_signer.rb
index 8a0b7cfde9..631afa87c4 100644
--- a/test/rubygems/test_gem_security_signer.rb
+++ b/test/rubygems/test_gem_security_signer.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'rubygems/test_case'
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping Gem::Security::Signer tests. openssl not found.'
end
@@ -216,4 +216,3 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
end
end if defined?(OpenSSL::SSL)
-
diff --git a/test/rubygems/test_gem_security_trust_dir.rb b/test/rubygems/test_gem_security_trust_dir.rb
index ab02ceb772..f2b7b006dd 100644
--- a/test/rubygems/test_gem_security_trust_dir.rb
+++ b/test/rubygems/test_gem_security_trust_dir.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'rubygems/test_case'
-unless defined?(OpenSSL::SSL) then
+unless defined?(OpenSSL::SSL)
warn 'Skipping Gem::Security::TrustDir tests. openssl not found.'
end
@@ -98,4 +98,3 @@ class TestGemSecurityTrustDir < Gem::TestCase
end
end if defined?(OpenSSL::SSL)
-
diff --git a/test/rubygems/test_gem_source.rb b/test/rubygems/test_gem_source.rb
index a969aae9ed..f8cd031c72 100644
--- a/test/rubygems/test_gem_source.rb
+++ b/test/rubygems/test_gem_source.rb
@@ -236,4 +236,3 @@ class TestGemSource < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_source_fetch_problem.rb b/test/rubygems/test_gem_source_fetch_problem.rb
index 4a245f25df..f3b57e8384 100644
--- a/test/rubygems/test_gem_source_fetch_problem.rb
+++ b/test/rubygems/test_gem_source_fetch_problem.rb
@@ -25,4 +25,3 @@ class TestGemSourceFetchProblem < Gem::TestCase
refute_match sf.wordy, 'secret'
end
end
-
diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb
index 8f5d3ee745..586e71bae6 100644
--- a/test/rubygems/test_gem_source_git.rb
+++ b/test/rubygems/test_gem_source_git.rb
@@ -306,4 +306,3 @@ class TestGemSourceGit < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_source_installed.rb b/test/rubygems/test_gem_source_installed.rb
index 6c7974831f..b469f842fc 100644
--- a/test/rubygems/test_gem_source_installed.rb
+++ b/test/rubygems/test_gem_source_installed.rb
@@ -34,4 +34,3 @@ class TestGemSourceInstalled < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_source_lock.rb b/test/rubygems/test_gem_source_lock.rb
index 6bd4002b6c..6edfb00e1a 100644
--- a/test/rubygems/test_gem_source_lock.rb
+++ b/test/rubygems/test_gem_source_lock.rb
@@ -112,4 +112,3 @@ class TestGemSourceLock < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_source_vendor.rb b/test/rubygems/test_gem_source_vendor.rb
index 01b20bdd51..3082bb7e68 100644
--- a/test/rubygems/test_gem_source_vendor.rb
+++ b/test/rubygems/test_gem_source_vendor.rb
@@ -29,4 +29,3 @@ class TestGemSourceVendor < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb
index 558869fe99..99862ce871 100644
--- a/test/rubygems/test_gem_spec_fetcher.rb
+++ b/test/rubygems/test_gem_spec_fetcher.rb
@@ -328,4 +328,3 @@ class TestGemSpecFetcher < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 0a7531af53..821fa93311 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -1561,7 +1561,7 @@ dependencies: []
@ext.build_extensions
refute_path_exists @ext.extension_dir
ensure
- unless ($DEBUG or win_platform? or Process.uid.zero?) then
+ unless ($DEBUG or win_platform? or Process.uid.zero?)
FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions')
FileUtils.chmod 0755, @ext.base_dir
end
@@ -2131,7 +2131,7 @@ dependencies: []
remove_method :default_ext_dir_for
end
- def Gem.default_ext_dir_for base_dir
+ def Gem.default_ext_dir_for(base_dir)
'/foo'
end
@@ -2613,7 +2613,7 @@ end
end
end
- def x s; s.gsub(/xxx/, ''); end
+ def x(s); s.gsub(/xxx/, ''); end
def w; x "WARxxxNING"; end
def t; x "TOxxxDO"; end
def f; x "FxxxIXME"; end
@@ -2875,7 +2875,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
end
def test_validate_empty_require_paths
- if win_platform? then
+ if win_platform?
skip 'test_validate_empty_require_paths skipped on MS Windows (symlink)'
else
util_setup_validate
@@ -2914,6 +2914,8 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
def test_unresolved_specs
specification = Gem::Specification.clone
+ set_orig specification
+
specification.define_singleton_method(:unresolved_deps) do
{ b: Gem::Dependency.new("x","1") }
end
@@ -2937,6 +2939,8 @@ Please report a bug if this causes problems.
def test_unresolved_specs_with_versions
specification = Gem::Specification.clone
+ set_orig specification
+
specification.define_singleton_method(:unresolved_deps) do
{ b: Gem::Dependency.new("x","1") }
end
@@ -2963,6 +2967,12 @@ Please report a bug if this causes problems.
end
end
+ def set_orig(cls)
+ s_cls = cls.singleton_class
+ s_cls.send :alias_method, :orig_unresolved_deps , :unresolved_deps
+ s_cls.send :alias_method, :orig_find_all_by_name, :find_all_by_name
+ end
+
def test_validate_files_recursive
util_setup_validate
FileUtils.touch @a1.file_name
diff --git a/test/rubygems/test_gem_stream_ui.rb b/test/rubygems/test_gem_stream_ui.rb
index 342b7071a6..5735bbc9a9 100644
--- a/test/rubygems/test_gem_stream_ui.rb
+++ b/test/rubygems/test_gem_stream_ui.rb
@@ -4,7 +4,6 @@ require 'rubygems/user_interaction'
require 'timeout'
class TestGemStreamUI < Gem::TestCase
- SHORT_TIMEOUT = (defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?) ? 1.0 : 0.1 # increase timeout with MJIT for --jit-wait testing
module IsTty
attr_accessor :tty
@@ -48,7 +47,7 @@ class TestGemStreamUI < Gem::TestCase
def test_ask_no_tty
@in.tty = false
- Timeout.timeout(SHORT_TIMEOUT) do
+ Timeout.timeout(0.1) do
answer = @sui.ask("what is your favorite color?")
assert_nil answer
end
@@ -66,7 +65,7 @@ class TestGemStreamUI < Gem::TestCase
def test_ask_for_password_no_tty
@in.tty = false
- Timeout.timeout(SHORT_TIMEOUT) do
+ Timeout.timeout(0.1) do
answer = @sui.ask_for_password("what is the airspeed velocity of an unladen swallow?")
assert_nil answer
end
@@ -75,7 +74,7 @@ class TestGemStreamUI < Gem::TestCase
def test_ask_yes_no_no_tty_with_default
@in.tty = false
- Timeout.timeout(SHORT_TIMEOUT) do
+ Timeout.timeout(0.1) do
answer = @sui.ask_yes_no("do coconuts migrate?", false)
assert_equal false, answer
@@ -87,7 +86,7 @@ class TestGemStreamUI < Gem::TestCase
def test_ask_yes_no_no_tty_without_default
@in.tty = false
- Timeout.timeout(SHORT_TIMEOUT) do
+ Timeout.timeout(0.1) do
assert_raises(Gem::OperationNotSupportedError) do
@sui.ask_yes_no("do coconuts migrate?")
end
diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb
index f9a3a236c0..3988206944 100644
--- a/test/rubygems/test_gem_stub_specification.rb
+++ b/test/rubygems/test_gem_stub_specification.rb
@@ -240,7 +240,6 @@ end
return stub
end
-
end
def stub_with_extension
@@ -293,4 +292,3 @@ end
end
end
-
diff --git a/test/rubygems/test_gem_unsatisfiable_dependency_error.rb b/test/rubygems/test_gem_unsatisfiable_dependency_error.rb
index 8b9c5604c9..e68185ce25 100644
--- a/test/rubygems/test_gem_unsatisfiable_dependency_error.rb
+++ b/test/rubygems/test_gem_unsatisfiable_dependency_error.rb
@@ -30,4 +30,3 @@ class TestGemUnsatisfiableDependencyError < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_uri_formatter.rb b/test/rubygems/test_gem_uri_formatter.rb
index c16ce98d23..b19bae9939 100644
--- a/test/rubygems/test_gem_uri_formatter.rb
+++ b/test/rubygems/test_gem_uri_formatter.rb
@@ -26,4 +26,3 @@ class TestGemUriFormatter < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb
index 93171f0813..0fd8441d26 100644
--- a/test/rubygems/test_gem_util.rb
+++ b/test/rubygems/test_gem_util.rb
@@ -59,4 +59,3 @@ class TestGemUtil < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_validator.rb b/test/rubygems/test_gem_validator.rb
index 5365a1dabb..b9f597b7d3 100644
--- a/test/rubygems/test_gem_validator.rb
+++ b/test/rubygems/test_gem_validator.rb
@@ -43,4 +43,3 @@ class TestGemValidator < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_gem_version.rb b/test/rubygems/test_gem_version.rb
index a2572fb611..939360c7a2 100644
--- a/test/rubygems/test_gem_version.rb
+++ b/test/rubygems/test_gem_version.rb
@@ -212,19 +212,19 @@ class TestGemVersion < Gem::TestCase
# Asserts that +version+ is a prerelease.
- def assert_prerelease version
+ def assert_prerelease(version)
assert v(version).prerelease?, "#{version} is a prerelease"
end
# Assert that +expected+ is the "approximate" recommendation for +version+.
- def assert_approximate_equal expected, version
+ def assert_approximate_equal(expected, version)
assert_equal expected, v(version).approximate_recommendation
end
# Assert that the "approximate" recommendation for +version+ satifies +version+.
- def assert_approximate_satisfies_itself version
+ def assert_approximate_satisfies_itself(version)
gem_version = v(version)
assert Gem::Requirement.new(gem_version.approximate_recommendation).satisfied_by?(gem_version)
@@ -232,33 +232,33 @@ class TestGemVersion < Gem::TestCase
# Assert that bumping the +unbumped+ version yields the +expected+.
- def assert_bumped_version_equal expected, unbumped
+ def assert_bumped_version_equal(expected, unbumped)
assert_version_equal expected, v(unbumped).bump
end
# Assert that +release+ is the correct non-prerelease +version+.
- def assert_release_equal release, version
+ def assert_release_equal(release, version)
assert_version_equal release, v(version).release
end
# Assert that two versions are equal. Handles strings or
# Gem::Version instances.
- def assert_version_equal expected, actual
+ def assert_version_equal(expected, actual)
assert_equal v(expected), v(actual)
assert_equal v(expected).hash, v(actual).hash, "since #{actual} == #{expected}, they must have the same hash"
end
# Assert that two versions are eql?. Checks both directions.
- def assert_version_eql first, second
+ def assert_version_eql(first, second)
first, second = v(first), v(second)
assert first.eql?(second), "#{first} is eql? #{second}"
assert second.eql?(first), "#{second} is eql? #{first}"
end
- def assert_less_than left, right
+ def assert_less_than(left, right)
l = v(left)
r = v(right)
assert l < r, "#{left} not less than #{right}"
@@ -266,14 +266,14 @@ class TestGemVersion < Gem::TestCase
# Refute the assumption that +version+ is a prerelease.
- def refute_prerelease version
+ def refute_prerelease(version)
refute v(version).prerelease?, "#{version} is NOT a prerelease"
end
# Refute the assumption that two versions are eql?. Checks both
# directions.
- def refute_version_eql first, second
+ def refute_version_eql(first, second)
first, second = v(first), v(second)
refute first.eql?(second), "#{first} is NOT eql? #{second}"
refute second.eql?(first), "#{second} is NOT eql? #{first}"
@@ -281,7 +281,7 @@ class TestGemVersion < Gem::TestCase
# Refute the assumption that the two versions are equal?.
- def refute_version_equal unexpected, actual
+ def refute_version_equal(unexpected, actual)
refute_equal v(unexpected), v(actual)
end
end
diff --git a/test/rubygems/test_gem_version_option.rb b/test/rubygems/test_gem_version_option.rb
index c06c716616..a680c5154e 100644
--- a/test/rubygems/test_gem_version_option.rb
+++ b/test/rubygems/test_gem_version_option.rb
@@ -164,4 +164,3 @@ class TestGemVersionOption < Gem::TestCase
end
end
-
diff --git a/test/rubygems/test_remote_fetch_error.rb b/test/rubygems/test_remote_fetch_error.rb
index 6b0f5477d6..432c48b878 100644
--- a/test/rubygems/test_remote_fetch_error.rb
+++ b/test/rubygems/test_remote_fetch_error.rb
@@ -18,4 +18,3 @@ class TestRemoteFetchError < Gem::TestCase
assert_equal error.to_s, 'There was an error fetching (https://gemsource.org)'
end
end
-
diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb
index 6af896507a..e3bdc218f7 100644
--- a/test/rubygems/test_require.rb
+++ b/test/rubygems/test_require.rb
@@ -4,7 +4,7 @@ require 'rubygems'
class TestGemRequire < Gem::TestCase
class Latch
- def initialize count = 1
+ def initialize(count = 1)
@count = count
@lock = Monitor.new
@cv = @lock.new_cond