mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
71110cb745
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
36 lines
959 B
Ruby
36 lines
959 B
Ruby
require 'rubygems/test_case'
|
|
require 'rubygems/dependency_resolver'
|
|
|
|
class TestGemDependencyResolverDependencyConflict < Gem::TestCase
|
|
|
|
def test_explanation
|
|
root =
|
|
dependency_request dep('net-ssh', '>= 2.0.13'), 'rye', '0.9.8'
|
|
child =
|
|
dependency_request dep('net-ssh', '>= 2.6.5'), 'net-ssh', '2.2.2', root
|
|
|
|
conflict =
|
|
Gem::DependencyResolver::DependencyConflict.new child, child.requester
|
|
|
|
expected = <<-EXPECTED
|
|
Activated net-ssh-2.2.2 instead of (>= 2.6.5) via:
|
|
net-ssh-2.2.2, rye-0.9.8
|
|
EXPECTED
|
|
|
|
assert_equal expected, conflict.explanation
|
|
end
|
|
|
|
def test_request_path
|
|
root =
|
|
dependency_request dep('net-ssh', '>= 2.0.13'), 'rye', '0.9.8'
|
|
child =
|
|
dependency_request dep('net-ssh', '>= 2.6.5'), 'net-ssh', '2.2.2', root
|
|
|
|
conflict =
|
|
Gem::DependencyResolver::DependencyConflict.new child, nil
|
|
|
|
assert_equal %w[net-ssh-2.2.2 rye-0.9.8], conflict.request_path
|
|
end
|
|
|
|
end
|
|
|