Sha256: 85620393f1023f4ab3c4e39efe9cba71b3d93f995b2230d08b8929468f6a409f

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

require 'rubygems/test_case'
require 'rubygems/dependency_resolver'

class TestGemDependencyResolverIndexSpecification < Gem::TestCase

  def test_initialize
    set     = Gem::DependencyResolver::IndexSet.new
    source  = Gem::Source.new @gem_repo
    version = Gem::Version.new '3.0.3'

    spec = Gem::DependencyResolver::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_spec
    @fetcher = Gem::FakeFetcher.new
    Gem::RemoteFetcher.fetcher = @fetcher

    a_2   = quick_spec 'a', 2
    a_2_p = quick_spec 'a', 2 do |s| s.platform = Gem::Platform.local end

    Gem::Specification.add_specs a_2, a_2_p

    util_setup_spec_fetcher a_2, a_2_p

    source = Gem::Source.new @gem_repo
    version = v 2

    set = Gem::DependencyResolver::IndexSet.new
    i_spec = Gem::DependencyResolver::IndexSpecification.new \
      set, 'a', version, source, Gem::Platform.local

    spec = i_spec.spec

    assert_equal a_2_p.full_name, spec.full_name
  end


end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubygems-update-2.1.7 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.6 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.5 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.4 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.3 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.2 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.1 test/rubygems/test_gem_dependency_resolver_index_specification.rb
rubygems-update-2.1.0 test/rubygems/test_gem_dependency_resolver_index_specification.rb