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 BeClose #:nodoc:
5 def initialize(expected, delta)
6 @expected = expected
7 @delta = delta
8 end
9
10 def matches?(actual)
11 @actual = actual
12 (@actual - @expected).abs < @delta
13 end
14
15 def failure_message
16 "expected #{@expected} +/- (< #{@delta}), got #{@actual}"
17 end
18
19 def description
20 "be close to #{@expected} (within +- #{@delta})"
21 end
22 end
23
24 # :call-seq:
25 # should be_close(expected, delta)
26 # should_not be_close(expected, delta)
27 #
28 # Passes if actual == expected +/- delta
29 #
30 # == Example
31 #
32 # result.should be_close(3.0, 0.5)
33 def be_close(expected, delta)
34 Matchers::BeClose.new(expected, delta)
35 end
36 end
37 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.