aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaoto Kaneko2017-09-22 16:57:27 +0900
committerNaoto Kaneko2017-09-22 16:57:27 +0900
commit557105640b5154e3fe1299aa31abdc106aa71df5 (patch)
treef1b7f75437b516e31319e13d0c736b8a7b972a5a
parent7d720e8fac6975aa402bf69361507982fbfc49ff (diff)
downloadbrew-557105640b5154e3fe1299aa31abdc106aa71df5.tar.bz2
Add a failure message to be_detected_from matcher
-rw-r--r--Library/Homebrew/test/version_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb
index cee57e935..6d6996316 100644
--- a/Library/Homebrew/test/version_spec.rb
+++ b/Library/Homebrew/test/version_spec.rb
@@ -241,8 +241,18 @@ describe Version do
describe "::detect" do
matcher :be_detected_from do |url, specs = {}|
- match do |version|
- Version.detect(url, specs) == version
+ detected = Version.detect(url, specs)
+
+ match do |expected|
+ detected == expected
+ end
+
+ failure_message do |expected|
+ format = <<-EOS
+ expected: %s
+ detected: %s
+ EOS
+ format % [expected, detected]
end
end