Add a failure message to be_detected_from matcher
This commit is contained in:
parent
7d720e8fac
commit
557105640b
@ -241,8 +241,18 @@ describe Version do
|
|||||||
|
|
||||||
describe "::detect" do
|
describe "::detect" do
|
||||||
matcher :be_detected_from do |url, specs = {}|
|
matcher :be_detected_from do |url, specs = {}|
|
||||||
match do |version|
|
detected = Version.detect(url, specs)
|
||||||
Version.detect(url, specs) == version
|
|
||||||
|
match do |expected|
|
||||||
|
detected == expected
|
||||||
|
end
|
||||||
|
|
||||||
|
failure_message do |expected|
|
||||||
|
format = <<-EOS
|
||||||
|
expected: %s
|
||||||
|
detected: %s
|
||||||
|
EOS
|
||||||
|
format % [expected, detected]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user