C0 code coverage information
Generated on Mon Aug 13 01:18:54 -0400 2007 with rcov 0.8.0
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 module Spec
2 module Expectations
3
4 module MatcherHandlerHelper
5 def describe(matcher)
6 matcher.respond_to?(:description) ? matcher.description : "[#{matcher.class.name} does not provide a description]"
7 end
8 end
9
10 class ExpectationMatcherHandler
11 class << self
12 include MatcherHandlerHelper
13 def handle_matcher(actual, matcher, &block)
14 match = matcher.matches?(actual, &block)
15 ::Spec::Matchers.generated_description = "should #{describe(matcher)}"
16 Spec::Expectations.fail_with(matcher.failure_message) unless match
17 end
18 end
19 end
20
21 class NegativeExpectationMatcherHandler
22 class << self
23 include MatcherHandlerHelper
24 def handle_matcher(actual, matcher, &block)
25 unless matcher.respond_to?(:negative_failure_message)
26 Spec::Expectations.fail_with(
27 <<-EOF
28 Matcher does not support should_not.
29 See Spec::Matchers for more information
30 about matchers.
31 EOF
32 )
33 end
34 match = matcher.matches?(actual, &block)
35 ::Spec::Matchers.generated_description = "should not #{describe(matcher)}"
36 Spec::Expectations.fail_with(matcher.negative_failure_message) if match
37 end
38 end
39 end
40
41 end
42 end
43
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.