summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_dependency_resolver_installer_set.rb
blob: 6341c6bc731658a73fb3c17fadae2af15da6c0e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'rubygems/test_case'
require 'rubygems/dependency_resolver'

class TestGemDependencyResolverInstallerSet < Gem::TestCase

  def test_load_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::DependencyResolver::InstallerSet.new :remote

    spec = set.load_spec 'a', version, Gem::Platform.local, source

    assert_equal specs["a-2-#{Gem::Platform.local}"].full_name, spec.full_name
  end

end