diff options
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem_commands_build_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_cert_command.rb | 4 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_owner_command.rb | 6 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_push_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_signin_command.rb | 4 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_yank_command.rb | 6 | ||||
-rw-r--r-- | test/rubygems/test_gem_config_file.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_gemcutter_utilities.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_source.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_spec_fetcher.rb | 2 |
10 files changed, 28 insertions, 4 deletions
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 76ede1466f..ac5d2ddd16 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -398,6 +398,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase skip 'openssl is missing' unless defined?(OpenSSL::SSL) && !java_platform? gem_path = File.join Gem.user_home, ".gem" + Dir.mkdir gem_path Gem::Security.trust_dir @@ -441,6 +442,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase skip 'openssl is missing' unless defined?(OpenSSL::SSL) && !java_platform? gem_path = File.join Gem.user_home, ".gem" + Dir.mkdir gem_path Gem::Security.trust_dir diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb index bb9ed9e630..fd1e66b915 100644 --- a/test/rubygems/test_gem_commands_cert_command.rb +++ b/test/rubygems/test_gem_commands_cert_command.rb @@ -597,6 +597,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis def test_execute_re_sign gem_path = File.join Gem.user_home, ".gem" + Dir.mkdir gem_path path = File.join @tempdir, 'cert.pem' Gem::Security.write EXPIRED_PUBLIC_CERT, path, 0600 @@ -627,6 +628,9 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis end def test_execute_re_sign_with_cert_expiration_length_days + gem_path = File.join Gem.user_home, ".gem" + Dir.mkdir gem_path + path = File.join @tempdir, 'cert.pem' Gem::Security.write EXPIRED_PUBLIC_CERT, path, 0600 diff --git a/test/rubygems/test_gem_commands_owner_command.rb b/test/rubygems/test_gem_commands_owner_command.rb index 685365ed3b..b830916fbe 100644 --- a/test/rubygems/test_gem_commands_owner_command.rb +++ b/test/rubygems/test_gem_commands_owner_command.rb @@ -19,6 +19,12 @@ class TestGemCommandsOwnerCommand < Gem::TestCase @cmd = Gem::Commands::OwnerCommand.new end + def teardown + credential_teardown + + super + end + def test_show_owners response = <<EOF --- diff --git a/test/rubygems/test_gem_commands_push_command.rb b/test/rubygems/test_gem_commands_push_command.rb index 877621d489..30bc589f92 100644 --- a/test/rubygems/test_gem_commands_push_command.rb +++ b/test/rubygems/test_gem_commands_push_command.rb @@ -40,6 +40,8 @@ class TestGemCommandsPushCommand < Gem::TestCase end def teardown + credential_teardown + super singleton_gem_class.class_eval do diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb index b559ddd331..5994050f51 100644 --- a/test/rubygems/test_gem_commands_signin_command.rb +++ b/test/rubygems/test_gem_commands_signin_command.rb @@ -17,8 +17,8 @@ class TestGemCommandsSigninCommand < Gem::TestCase end def teardown - credentials_path = Gem.configuration.credentials_path - File.delete(credentials_path) if File.exist?(credentials_path) + credential_teardown + super end diff --git a/test/rubygems/test_gem_commands_yank_command.rb b/test/rubygems/test_gem_commands_yank_command.rb index a9e4e03dea..e84c7eaadd 100644 --- a/test/rubygems/test_gem_commands_yank_command.rb +++ b/test/rubygems/test_gem_commands_yank_command.rb @@ -18,6 +18,12 @@ class TestGemCommandsYankCommand < Gem::TestCase Gem.configuration.api_keys[:KEY] = 'other' end + def teardown + credential_teardown + + super + end + def test_handle_options @cmd.handle_options %w[a --version 1.0 --platform x86-darwin -k KEY --host HOST] diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index 36725f9390..c79563d650 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -28,6 +28,8 @@ class TestGemConfigFile < Gem::TestCase ENV['GEMRC'] = @env_gemrc + credential_teardown + super end diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb index d82d6447e7..1d7ecf14b1 100644 --- a/test/rubygems/test_gem_gemcutter_utilities.rb +++ b/test/rubygems/test_gem_gemcutter_utilities.rb @@ -25,6 +25,8 @@ class TestGemGemcutterUtilities < Gem::TestCase ENV['RUBYGEMS_HOST'] = nil Gem.configuration.rubygems_api_key = nil + credential_teardown + super end diff --git a/test/rubygems/test_gem_source.rb b/test/rubygems/test_gem_source.rb index 88e89bd192..3b533febe4 100644 --- a/test/rubygems/test_gem_source.rb +++ b/test/rubygems/test_gem_source.rb @@ -228,7 +228,7 @@ class TestGemSource < Gem::TestCase end def test_update_cache_eh_home_nonexistent - FileUtils.rm_rf Gem.user_home + FileUtils.rmdir Gem.user_home refute @source.update_cache? end diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb index 0a55c5d2e8..b141a5b7b5 100644 --- a/test/rubygems/test_gem_spec_fetcher.rb +++ b/test/rubygems/test_gem_spec_fetcher.rb @@ -33,7 +33,7 @@ class TestGemSpecFetcher < Gem::TestCase end def test_initialize_nonexistent_home_dir - FileUtils.rm_rf Gem.user_home + FileUtils.rmdir Gem.user_home assert Gem::SpecFetcher.new end |