Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/reporter.rb | 79 | 66 | 93.67%
|
92.42%
|
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 RSpec::Core |
2 class Reporter |
3 def initialize(*formatters) |
4 @formatters = formatters |
5 @example_count = @failure_count = @pending_count = 0 |
6 @duration = @start = nil |
7 end |
8 |
9 def report(count) |
10 start(count) |
11 begin |
12 yield self |
13 ensure |
14 conclude |
15 end |
16 end |
17 |
18 def conclude |
19 begin |
20 stop |
21 notify :start_dump |
22 notify :dump_pending |
23 notify :dump_failures |
24 notify :dump_summary, @duration, @example_count, @failure_count, @pending_count |
25 ensure |
26 notify :close |
27 end |
28 end |
29 |
30 alias_method :abort, :conclude |
31 |
32 def start(expected_example_count) |
33 @start = Time.now |
34 notify :start, expected_example_count |
35 end |
36 |
37 def message(message) |
38 notify :message, message |
39 end |
40 |
41 def example_group_started(group) |
42 notify :example_group_started, group |
43 end |
44 |
45 def example_group_finished(group) |
46 notify :example_group_finished, group |
47 end |
48 |
49 def example_started(example) |
50 @example_count += 1 |
51 notify :example_started, example |
52 end |
53 |
54 def example_passed(example) |
55 notify :example_passed, example |
56 end |
57 |
58 def example_failed(example) |
59 @failure_count += 1 |
60 notify :example_failed, example |
61 end |
62 |
63 def example_pending(example) |
64 @pending_count += 1 |
65 notify :example_pending, example |
66 end |
67 |
68 def stop |
69 @duration = Time.now - @start if @start |
70 notify :stop |
71 end |
72 |
73 def notify(method, *args, &block) |
74 @formatters.each do |formatter| |
75 formatter.send method, *args, &block |
76 end |
77 end |
78 end |
79 end |
Generated on Fri Apr 22 17:22:42 -0700 2011 with rcov 0.9.8