aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_resolver_git_set.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_resolver_git_set.rb')
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb28
1 files changed, 23 insertions, 5 deletions
diff --git a/test/rubygems/test_gem_resolver_git_set.rb b/test/rubygems/test_gem_resolver_git_set.rb
index b1a8d838bb..4643624ee0 100644
--- a/test/rubygems/test_gem_resolver_git_set.rb
+++ b/test/rubygems/test_gem_resolver_git_set.rb
@@ -36,13 +36,31 @@ class TestGemResolverGitSet < Gem::TestCase
assert @set.need_submodules[repository]
end
+ def test_add_git_spec
+ name, version, repository, revision = git_gem
+
+ @set.add_git_spec name, version, repository, revision, true
+
+ dependency = dep 'a'
+
+ specs = @set.find_all dependency
+
+ spec = specs.first
+
+ assert_equal "#{name}-#{version}", spec.full_name
+
+ assert @set.need_submodules[repository]
+
+ refute_path_exists spec.source.repo_cache_dir
+ end
+
def test_find_all
name, _, repository, = git_gem
@set.add_git_gem name, repository, 'master', false
dependency = dep 'a', '~> 1.0'
- req = Gem::Resolver::ActivationRequest.new dependency, nil
+ req = Gem::Resolver::DependencyRequest.new dependency, nil
@reqs.add req
@set.prefetch @reqs
@@ -66,7 +84,7 @@ class TestGemResolverGitSet < Gem::TestCase
@set.add_git_gem name, repository, 'master', false
dependency = dep name
- req = Gem::Resolver::ActivationRequest.new dependency, nil
+ req = Gem::Resolver::DependencyRequest.new dependency, nil
@reqs.add req
@set.prefetch @reqs
@@ -80,7 +98,7 @@ class TestGemResolverGitSet < Gem::TestCase
@set.add_git_gem name, repository, 'master', false
dependency = dep name
- req = Gem::Resolver::ActivationRequest.new dependency, nil
+ req = Gem::Resolver::DependencyRequest.new dependency, nil
@reqs.add req
@set.prefetch @reqs
@@ -98,7 +116,7 @@ class TestGemResolverGitSet < Gem::TestCase
@set.add_git_gem name, repository, 'master', false
dependency = dep 'b'
- req = Gem::Resolver::ActivationRequest.new dependency, nil
+ req = Gem::Resolver::DependencyRequest.new dependency, nil
@reqs.add req
@set.prefetch @reqs
@@ -112,7 +130,7 @@ class TestGemResolverGitSet < Gem::TestCase
@set.add_git_gem name, repository, 'master', false
dependency = dep name
- req = Gem::Resolver::ActivationRequest.new dependency, nil
+ req = Gem::Resolver::DependencyRequest.new dependency, nil
@reqs.add req
@set.root_dir = "#{@gemhome}2"