1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/rubygems/test_gem_dependency_resolver_api_specification.rb
drbrain f06f903231 * lib/rubygems: Update to RubyGems 2.1.0. Fixes CVE-2013-4287.
See http://rubygems.rubyforge.org/rubygems-update/CVE-2013-4287_txt.html
  for CVE information.

  See http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.1.0+%2F+2013-09-09
  for release notes.

* test/rubygems:  Tests for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-10 00:52:14 +00:00

33 lines
822 B
Ruby

require 'rubygems/test_case'
require 'rubygems/dependency_resolver'
class TestGemDependencyResolverAPISpecification < Gem::TestCase
def test_initialize
set = Gem::DependencyResolver::APISet.new
data = {
:name => 'rails',
:number => '3.0.3',
:platform => 'ruby',
:dependencies => [
['bundler', '~> 1.0'],
['railties', '= 3.0.3'],
],
}
spec = Gem::DependencyResolver::APISpecification.new set, data
assert_equal 'rails', spec.name
assert_equal Gem::Version.new('3.0.3'), spec.version
assert_equal Gem::Platform::RUBY, spec.platform
expected = [
Gem::Dependency.new('bundler', '~> 1.0'),
Gem::Dependency.new('railties', '= 3.0.3'),
]
assert_equal expected, spec.dependencies
end
end