ruby-changes:66167
From: Hiroshi <ko1@a...>
Date: Wed, 12 May 2021 17:25:09 +0900 (JST)
Subject: [ruby-changes:66167] 3948be3503 (master): [rubygems/rubygems] Use assert_path_exist and assert_path_not_exist instead of assert_path_exists and refute_path_exists
https://git.ruby-lang.org/ruby.git/commit/?id=3948be3503 From 3948be350312b908ea3ecf32ecf1adf420fe74ca Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Mon, 25 May 2020 21:05:45 +0900 Subject: [rubygems/rubygems] Use assert_path_exist and assert_path_not_exist instead of assert_path_exists and refute_path_exists https://github.com/rubygems/rubygems/commit/a7c93558c3 --- lib/rubygems/test_case.rb | 2 +- test/rubygems/test_gem.rb | 14 +- test/rubygems/test_gem_commands_cert_command.rb | 44 +++---- test/rubygems/test_gem_commands_check_command.rb | 8 +- test/rubygems/test_gem_commands_cleanup_command.rb | 48 +++---- test/rubygems/test_gem_commands_fetch_command.rb | 18 +-- test/rubygems/test_gem_commands_install_command.rb | 8 +- .../rubygems/test_gem_commands_pristine_command.rb | 26 ++-- test/rubygems/test_gem_commands_setup_command.rb | 42 +++--- test/rubygems/test_gem_commands_unpack_command.rb | 2 +- test/rubygems/test_gem_commands_update_command.rb | 8 +- test/rubygems/test_gem_dependency_installer.rb | 2 +- test/rubygems/test_gem_doctor.rb | 52 ++++---- test/rubygems/test_gem_ext_builder.rb | 34 ++--- test/rubygems/test_gem_ext_ext_conf_builder.rb | 4 +- test/rubygems/test_gem_install_update_options.rb | 4 +- test/rubygems/test_gem_installer.rb | 144 ++++++++++----------- test/rubygems/test_gem_package.rb | 28 ++-- test/rubygems/test_gem_package_old.rb | 2 +- test/rubygems/test_gem_package_task.rb | 2 +- test/rubygems/test_gem_rdoc.rb | 4 +- test/rubygems/test_gem_remote_fetcher.rb | 2 +- test/rubygems/test_gem_request_set.rb | 22 ++-- test/rubygems/test_gem_request_set_lockfile.rb | 4 +- test/rubygems/test_gem_resolver_git_set.rb | 2 +- .../test_gem_resolver_git_specification.rb | 2 +- .../test_gem_resolver_index_specification.rb | 2 +- .../test_gem_resolver_local_specification.rb | 2 +- test/rubygems/test_gem_resolver_specification.rb | 2 +- test/rubygems/test_gem_security.rb | 6 +- test/rubygems/test_gem_security_signer.rb | 2 +- test/rubygems/test_gem_security_trust_dir.rb | 6 +- test/rubygems/test_gem_source_git.rb | 16 +-- test/rubygems/test_gem_specification.rb | 18 +-- test/rubygems/test_gem_uninstaller.rb | 18 +-- test/rubygems/test_require.rb | 4 +- 36 files changed, 302 insertions(+), 302 deletions(-) diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 7725561..7075347 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -141,7 +141,7 @@ class Gem::TestCase < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L141 def assert_directory_exists(path, msg = nil) msg = build_message(msg, "Expected path '#{path}' to be a directory") - assert_path_exists path + assert_path_exist path assert File.directory?(path), msg end diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index b3c8a7a..2b39301 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -106,7 +106,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L106 assert_equal %w[a-1], installed.map {|spec| spec.full_name } - assert_path_exists File.join(gemhome2, 'gems', 'a-1') + assert_path_exist File.join(gemhome2, 'gems', 'a-1') end def test_self_install_in_rescue @@ -692,12 +692,12 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L692 Gem.ensure_gem_subdirectories @gemhome - assert_path_exists File.join @gemhome, 'build_info' - assert_path_exists File.join @gemhome, 'cache' - assert_path_exists File.join @gemhome, 'doc' - assert_path_exists File.join @gemhome, 'extensions' - assert_path_exists File.join @gemhome, 'gems' - assert_path_exists File.join @gemhome, 'specifications' + assert_path_exist File.join @gemhome, 'build_info' + assert_path_exist File.join @gemhome, 'cache' + assert_path_exist File.join @gemhome, 'doc' + assert_path_exist File.join @gemhome, 'extensions' + assert_path_exist File.join @gemhome, 'gems' + assert_path_exist File.join @gemhome, 'specifications' end def test_self_ensure_gem_directories_permissions diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb index 19867bf..bd19ac3 100644 --- a/test/rubygems/test_gem_commands_cert_command.rb +++ b/test/rubygems/test_gem_commands_cert_command.rb @@ -83,7 +83,7 @@ class TestGemCommandsCertCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L83 cert_path = @trust_dir.cert_path PUBLIC_CERT - assert_path_exists cert_path + assert_path_exist cert_path assert_equal "Added '/CN=nobody/DC=example'\n", @ui.output assert_empty @ui.error @@ -138,8 +138,8 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L138 assert_empty output assert_empty @build_ui.error - assert_path_exists File.join(@tempdir, 'gem-private_key.pem') - assert_path_exists File.join(@tempdir, 'gem-public_cert.pem') + assert_path_exist File.join(@tempdir, 'gem-private_key.pem') + assert_path_exist File.join(@tempdir, 'gem-public_cert.pem') end def test_execute_build_bad_email_address @@ -159,8 +159,8 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L159 assert_equal "Invalid email address #{email}", e.message - refute_path_exists File.join(@tempdir, 'gem-private_key.pem') - refute_path_exists File.join(@tempdir, 'gem-public_cert.pem') + assert_path_not_exist File.join(@tempdir, 'gem-private_key.pem') + assert_path_not_exist File.join(@tempdir, 'gem-public_cert.pem') end end @@ -195,8 +195,8 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L195 assert_empty output assert_empty @build_ui.error - assert_path_exists File.join(@tempdir, 'gem-private_key.pem') - assert_path_exists File.join(@tempdir, 'gem-public_cert.pem') + assert_path_exist File.join(@tempdir, 'gem-private_key.pem') + assert_path_exist File.join(@tempdir, 'gem-public_cert.pem') pem = File.read("#{@tempdir}/gem-public_cert.pem") cert = OpenSSL::X509::Certificate.new(pem) @@ -232,8 +232,8 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L232 end - refute_path_exists File.join(@tempdir, 'gem-private_key.pem') - refute_path_exists File.join(@tempdir, 'gem-public_cert.pem') + assert_path_not_exist File.join(@tempdir, 'gem-private_key.pem') + assert_path_not_exist File.join(@tempdir, 'gem-public_cert.pem') end def test_execute_build_key @@ -254,8 +254,8 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L254 assert_empty output assert_empty @ui.error - assert_path_exists File.join(@tempdir, 'gem-public_cert.pem') - refute_path_exists File.join(@tempdir, 'gem-private_key.pem') + assert_path_exist File.join(@tempdir, 'gem-public_cert.pem') + assert_path_not_exist File.join(@tempdir, 'gem-private_key.pem') end def test_execute_build_encrypted_key @@ -276,7 +276,7 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L276 assert_empty output assert_empty @ui.error - assert_path_exists File.join(@tempdir, 'gem-public_cert.pem') + assert_path_exist File.join(@tempdir, 'gem-public_cert.pem') end def test_execute_certificate @@ -346,7 +346,7 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L346 cert_path = @trust_dir.cert_path PUBLIC_CERT - assert_path_exists cert_path + assert_path_exist cert_path @cmd.handle_options %W[--remove nobody] @@ -357,7 +357,7 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L357 assert_equal "Removed '/CN=nobody/DC=example'\n", @ui.output assert_equal '', @ui.error - refute_path_exists cert_path + assert_path_not_exist cert_path end def test_execute_remove_multiple @@ -367,8 +367,8 @@ Added '/CN=alternate/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L367 public_path = @trust_dir.cert_path PUBLIC_CERT alternate_path = @trust_dir.cert_path ALTERNATE_CERT - assert_path_exists public_path - assert_path_exists alternate_path + assert_path_exist public_path + assert_path_exist alternate_path @cmd.handle_options %W[--remove example] @@ -384,8 +384,8 @@ Removed '/CN=nobody/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L384 assert_equal expected, @ui.output assert_equal '', @ui.error - refute_path_exists public_path - refute_path_exists alternate_path + assert_path_not_exist public_path + assert_path_not_exist alternate_path end def test_execute_remove_twice @@ -395,8 +395,8 @@ Removed '/CN=nobody/DC=example' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L395 public_path = @trust_dir.cert_path PUBLIC_CERT alternate_path = @trust_dir.cert_path ALTERNATE_CERT - asser (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/