Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/ruby_project.rb | 44 | 33 | 100.00%
|
100.00%
|
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 # This is borrowed (slightly modified) from Scott Taylor's |
2 # project_path project: |
3 # http://github.com/smtlaissezfaire/project_path |
4 |
5 require 'pathname' |
6 |
7 module RSpec |
8 module Core |
9 module RubyProject |
10 def add_to_load_path(*dirs) |
11 dirs.map {|dir| add_dir_to_load_path(File.join(root, dir))} |
12 end |
13 |
14 def add_dir_to_load_path(dir) # :nodoc: |
15 $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) |
16 end |
17 |
18 def root # :nodoc: |
19 @project_root ||= determine_root |
20 end |
21 |
22 def determine_root # :nodoc: |
23 find_first_parent_containing('spec') || '.' |
24 end |
25 |
26 def find_first_parent_containing(dir) # :nodoc: |
27 ascend_until {|path| File.exists?(File.join(path, dir))} |
28 end |
29 |
30 def ascend_until # :nodoc: |
31 Pathname(File.expand_path('.')).ascend do |path| |
32 return path if yield(path) |
33 end |
34 end |
35 |
36 module_function :add_to_load_path |
37 module_function :add_dir_to_load_path |
38 module_function :root |
39 module_function :determine_root |
40 module_function :find_first_parent_containing |
41 module_function :ascend_until |
42 end |
43 end |
44 end |
Generated on Fri Apr 22 17:22:42 -0700 2011 with rcov 0.9.8