diff options
-rw-r--r-- | test/rubygems/test_gem_available_set.rb | 19 | ||||
-rw-r--r-- | test/rubygems/test_gem_dependency_installer.rb | 3 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver.rb | 1 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_api_specification.rb | 36 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_git_specification.rb | 14 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_index_specification.rb | 22 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_installed_specification.rb | 37 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_local_specification.rb | 45 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_specification.rb | 32 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_vendor_set.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_vendor_specification.rb | 12 | ||||
-rw-r--r-- | test/rubygems/test_gem_source_git.rb | 11 | ||||
-rw-r--r-- | test/rubygems/test_gem_util.rb | 18 |
13 files changed, 247 insertions, 5 deletions
@@ -22,6 +22,25 @@ class TestGemAvailableSet < Gem::TestCase assert_equal [a1], set.all_specs end def test_match_platform a1, _ = util_gem 'a', '1' do |g| g.platform = "something-weird-yep" @@ -719,6 +719,9 @@ class TestGemDependencyInstaller < Gem::TestCase inst.install 'a' end ENV['GEM_HOME'] = @gemhome ENV['GEM_PATH'] = [@gemhome, gemhome2].join File::PATH_SEPARATOR Gem.clear_paths @@ -151,6 +151,7 @@ class TestGemResolver < Gem::TestCase a2_p1 = a3_p2 = nil spec_fetcher do |fetcher| a2_p1 = fetcher.spec 'a', 2 do |s| s.platform = Gem::Platform.local end a3_p2 = fetcher.spec 'a', 3 do |s| s.platform = unknown end end @@ -28,6 +28,42 @@ class TestGemResolverAPISpecification < Gem::TestCase assert_equal expected, spec.dependencies end def test_source set = Gem::Resolver::APISet.new data = { @@ -32,5 +32,19 @@ class TestGemResolverGitSpecification < Gem::TestCase refute_equal g_spec_a, i_spec end end @@ -29,6 +29,28 @@ class TestGemResolverIndexSpecification < Gem::TestCase assert_equal Gem::Platform.local.to_s, spec.platform end def test_spec specs = spec_fetcher do |fetcher| fetcher.spec 'a', 2 @@ -2,17 +2,48 @@ require 'rubygems/test_case' class TestGemResolverInstalledSpecification < Gem::TestCase - def test_initialize - set = Gem::Resolver::CurrentSet.new source_spec = util_spec 'a' - spec = Gem::Resolver::InstalledSpecification.new set, source_spec assert_equal 'a', spec.name assert_equal Gem::Version.new(2), spec.version assert_equal Gem::Platform::RUBY, spec.platform end end @@ -0,0 +1,45 @@ @@ -0,0 +1,32 @@ @@ -16,6 +16,8 @@ class TestGemResolverVendorSet < Gem::TestCase spec = @set.load_spec name, version, Gem::Platform::RUBY, nil assert_equal "#{name}-#{version}", spec.full_name end def test_add_vendor_gem_missing @@ -47,6 +47,18 @@ class TestGemResolverVendorSpecification < Gem::TestCase assert_equal 'a-1', v_spec.full_name end def test_name v_spec = Gem::Resolver::VendorSpecification.new @set, @spec @@ -25,7 +25,8 @@ class TestGemSourceGit < Gem::TestCase git_gem 'b' Dir.chdir 'git/a' do - system @git, 'submodule', '--quiet', 'add', File.expand_path('../b'), 'b', out: IO::NULL system @git, 'commit', '--quiet', '-m', 'add submodule b' end @@ -161,6 +162,14 @@ class TestGemSourceGit < Gem::TestCase end assert_equal %w[a-1 b-1], specs.map { |spec| spec.full_name } end def test_uri_hash @@ -7,9 +7,25 @@ class TestGemUtil < Gem::TestCase assert_equal "0\n", Gem::Util.popen(Gem.ruby, '-e', 'p 0') assert_raises Errno::ECHILD do - Process.wait -1 end end end |