Author: lacton
Date: Sun Aug 24 10:58:42 2008
New Revision: 688541
URL: http://svn.apache.org/viewvc?rev=688541&view=rev
Log:
Improved failure messages for MessageWithSeverityMatcher
Modified:
incubator/buildr/trunk/spec/spec_helpers.rb
Modified: incubator/buildr/trunk/spec/spec_helpers.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/spec_helpers.rb?rev=688541&r1=688540&r2=688541&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/spec_helpers.rb (original)
+++ incubator/buildr/trunk/spec/spec_helpers.rb Sun Aug 24 10:58:42 2008
@@ -51,19 +51,18 @@
end
def matches?(target)
- $messages ||= {}
- [EMAIL PROTECTED] = []
+ $messages = [EMAIL PROTECTED] => []}
target.call
return Regexp === @expect ? [EMAIL PROTECTED]('\n') =~ @expect :
[EMAIL PROTECTED](@expect.to_s)
end
def failure_message
- $messages ? "Expected [EMAIL PROTECTED] '[EMAIL PROTECTED]', found
[EMAIL PROTECTED]" : \
- "Expected [EMAIL PROTECTED] '[EMAIL PROTECTED]', no [EMAIL
PROTECTED] issued"
+ "Expected [EMAIL PROTECTED] '[EMAIL PROTECTED]', " +
+ ([EMAIL PROTECTED] ? "no [EMAIL PROTECTED] issued" : "found [EMAIL
PROTECTED]")
end
def negative_failure_message
- "Found unexpected '[EMAIL PROTECTED]'"
+ "Found unexpected [EMAIL PROTECTED]"
end
end