diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-19 00:34:13 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-19 00:34:13 +0000 |
commit | a7fa4d5d9aab150ad4b0c3f3217fe444df69f527 (patch) | |
tree | 88ab96d22f7228b556337aa7c34042d4fd279394 /test/rubygems/test_gem_resolver_index_specification.rb | |
parent | e7ec3dad907f2c77f17faddb40a98b2ef4523222 (diff) | |
download | ruby-a7fa4d5d9aab150ad4b0c3f3217fe444df69f527.tar.gz |
* lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
Compatibly renamed Gem::DependencyResolver to Gem::Resolver.
Added support for git gems in gem.deps.rb and Gemfile.
Fixed resolver bugs.
* test/rubygems: ditto.
* lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk.
[ruby-trunk - Bug #9086]
* lib/rubygems/commands/which_command.rb: RubyGems now indicates
failure when any file is missing. [ruby-trunk - Bug #9004]
* lib/rubygems/ext/builder: Extensions are now installed into the
extension install directory and the first directory in the require
path from the gem. This allows backwards compatibility with msgpack
and other gems that calculate full require paths.
[ruby-trunk - Bug #9106]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_resolver_index_specification.rb')
-rw-r--r-- | test/rubygems/test_gem_resolver_index_specification.rb | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_resolver_index_specification.rb b/test/rubygems/test_gem_resolver_index_specification.rb new file mode 100644 index 0000000000..ef474ab2d4 --- /dev/null +++ b/test/rubygems/test_gem_resolver_index_specification.rb @@ -0,0 +1,67 @@ +require 'rubygems/test_case' +require 'rubygems/available_set' + +class TestGemResolverIndexSpecification < Gem::TestCase + + def test_initialize + set = Gem::Resolver::IndexSet.new + source = Gem::Source.new @gem_repo + version = Gem::Version.new '3.0.3' + + spec = Gem::Resolver::IndexSpecification.new( + set, 'rails', version, source, Gem::Platform::RUBY) + + assert_equal 'rails', spec.name + assert_equal version, spec.version + assert_equal Gem::Platform::RUBY, spec.platform + + assert_equal source, spec.source + end + + def test_initialize_platform + set = Gem::Resolver::IndexSet.new + source = Gem::Source::Local.new + version = Gem::Version.new '3.0.3' + + spec = Gem::Resolver::IndexSpecification.new( + set, 'rails', version, source, Gem::Platform.local) + + assert_equal Gem::Platform.local.to_s, spec.platform + end + + def test_spec + specs = spec_fetcher do |fetcher| + fetcher.spec 'a', 2 + fetcher.spec 'a', 2 do |s| s.platform = Gem::Platform.local end + end + + source = Gem::Source.new @gem_repo + version = v 2 + + set = Gem::Resolver::IndexSet.new + i_spec = Gem::Resolver::IndexSpecification.new \ + set, 'a', version, source, Gem::Platform.local + + spec = i_spec.spec + + assert_equal specs["a-2-#{Gem::Platform.local}"].full_name, spec.full_name + end + + def test_spec_local + a_2_p = util_spec 'a', 2 do |s| s.platform = Gem::Platform.local end + Gem::Package.build a_2_p + + source = Gem::Source::Local.new + set = Gem::Resolver::InstallerSet.new :local + set.always_install << a_2_p + + i_spec = Gem::Resolver::IndexSpecification.new \ + set, 'a', v(2), source, Gem::Platform.local + + spec = i_spec.spec + + assert_equal a_2_p.full_name, spec.full_name + end + +end + |