2013-11-10 21:51:40 +04:00
|
|
|
require 'rubygems/test_case'
|
|
|
|
|
|
|
|
class TestGemDependencyResolutionError < Gem::TestCase
|
|
|
|
|
|
|
|
def setup
|
|
|
|
super
|
|
|
|
|
2013-11-19 04:34:13 +04:00
|
|
|
@DR = Gem::Resolver
|
2013-11-10 21:51:40 +04:00
|
|
|
|
2013-11-12 04:16:41 +04:00
|
|
|
@spec = util_spec 'a', 2
|
2013-11-10 21:51:40 +04:00
|
|
|
|
|
|
|
@a1_req = @DR::DependencyRequest.new dep('a', '= 1'), nil
|
|
|
|
@a2_req = @DR::DependencyRequest.new dep('a', '= 2'), nil
|
|
|
|
|
|
|
|
@activated = @DR::ActivationRequest.new @spec, @a2_req
|
|
|
|
|
2013-11-19 04:34:13 +04:00
|
|
|
@conflict = @DR::Conflict.new @a1_req, @activated
|
2013-11-10 21:51:40 +04:00
|
|
|
|
|
|
|
@error = Gem::DependencyResolutionError.new @conflict
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_message
|
|
|
|
assert_match %r%^conflicting dependencies a \(= 1\) and a \(= 2\)$%,
|
|
|
|
@error.message
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|