Bug #13842 » rubygems-2613-ruby22-testcase.patch
| test/rubygems/test_gem_installer.rb | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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
|
||
- « Previous
- 1
- …
- 3
- 4
- 5
- Next »