Add a failure message to be_detected_from matcher

This commit is contained in:
Naoto Kaneko 2017-09-22 16:57:27 +09:00
parent 7d720e8fac
commit 557105640b

View File

@ -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