2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2013-11-10 12:51:40 -05:00
|
|
|
require 'rubygems/test_case'
|
|
|
|
|
|
|
|
class TestGemDependencyResolutionError < Gem::TestCase
|
|
|
|
def setup
|
|
|
|
super
|
|
|
|
|
2013-11-18 19:34:13 -05:00
|
|
|
@DR = Gem::Resolver
|
2013-11-10 12:51:40 -05:00
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
@spec = util_spec 'a', 2
|
2013-11-10 12:51:40 -05: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-18 19:34:13 -05:00
|
|
|
@conflict = @DR::Conflict.new @a1_req, @activated
|
2013-11-10 12:51:40 -05:00
|
|
|
|
|
|
|
@error = Gem::DependencyResolutionError.new @conflict
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_message
|
2020-03-24 14:51:43 -04:00
|
|
|
assert_match %r{^conflicting dependencies a \(= 1\) and a \(= 2\)$},
|
2013-11-10 12:51:40 -05:00
|
|
|
@error.message
|
|
|
|
end
|
|
|
|
end
|