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 Matchers
3
4 class Has #:nodoc:
5 def initialize(sym, *args)
6 @sym = sym
7 @args = args
8 end
9
10 def matches?(target)
11 @target = target
12 begin
13 return target.send(predicate, *@args)
14 rescue => @error
15 # This clause should be empty, but rcov will not report it as covered
16 # unless something (anything) is executed within the clause
17 rcov_error_report = "http://eigenclass.org/hiki.rb?rcov-0.8.0"
18 end
19 return false
20 end
21
22 def failure_message
23 raise @error if @error
24 "expected ##{predicate}(#{@args[0].inspect}) to return true, got false"
25 end
26
27 def negative_failure_message
28 raise @error if @error
29 "expected ##{predicate}(#{@args[0].inspect}) to return false, got true"
30 end
31
32 def description
33 "have key #{@args[0].inspect}"
34 end
35
36 private
37 def predicate
38 "#{@sym.to_s.sub("have_","has_")}?".to_sym
39 end
40
41 end
42
43 end
44 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.