C0 code coverage information
Generated on Mon Aug 13 01:18:55 -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 Runner
3 class BacktraceTweaker
4 def clean_up_double_slashes(line)
5 line.gsub!('//','/')
6 end
7 end
8
9 class NoisyBacktraceTweaker < BacktraceTweaker
10 def tweak_backtrace(error, spec_name)
11 return if error.backtrace.nil?
12 error.backtrace.each do |line|
13 clean_up_double_slashes(line)
14 end
15 end
16 end
17
18 # Tweaks raised Exceptions to mask noisy (unneeded) parts of the backtrace
19 class QuietBacktraceTweaker < BacktraceTweaker
20 unless defined?(IGNORE_PATTERNS)
21 root_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', '..'))
22 spec_files = Dir["#{root_dir}/lib/spec/*"].map do |path|
23 subpath = path[root_dir.length..-1]
24 /#{subpath}/
25 end
26 IGNORE_PATTERNS = spec_files + [
27 /\/lib\/ruby\//,
28 /bin\/spec:/,
29 /bin\/rcov:/,
30 /lib\/rspec_on_rails/,
31 /vendor\/rails/,
32 # TextMate's Ruby and RSpec plugins
33 /Ruby\.tmbundle\/Support\/tmruby.rb:/,
34 /RSpec\.tmbundle\/Support\/lib/,
35 /temp_textmate\./,
36 /mock_frameworks\/rspec/,
37 /spec_server/
38 ]
39 end
40
41 def tweak_backtrace(error, spec_name)
42 return if error.backtrace.nil?
43 error.backtrace.collect! do |line|
44 clean_up_double_slashes(line)
45 IGNORE_PATTERNS.each do |ignore|
46 if line =~ ignore
47 line = nil
48 break
49 end
50 end
51 line
52 end
53 error.backtrace.compact!
54 end
55 end
56 end
57 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.