diff --git test/rubygems/test_gem_installer.rb test/rubygems/test_gem_installer.rb index aba73af181..0a439cdf3d 100644 --- test/rubygems/test_gem_installer.rb +++ test/rubygems/test_gem_installer.rb @@ -1215,7 +1215,19 @@ gem 'other', version end def test_pre_install_checks_malicious_name - spec = util_spec '../malicious', '1' + spec = Gem::Specification.new do |s| + s.platform = Gem::Platform::RUBY + s.name = '../malicious' + s.version = '1' + s.author = 'A User' + s.email = 'example@example.com' + s.homepage = 'http://example.com' + s.summary = "this is a summary" + s.description = "This is a test description" + end + + Gem::Specification.reset + def spec.full_name # so the spec is buildable "malicious-1" end @@ -1226,7 +1238,7 @@ gem 'other', version gem = File.join(@gemhome, 'cache', spec.file_name) use_ui @ui do - @installer = Gem::Installer.at gem + @installer = Gem::Installer.new gem e = assert_raises Gem::InstallError do @installer.pre_install_checks end