Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/example/shared_example_group.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/example/shared_example_group.rb 59 48
47.46%
35.42%

Key

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.

Coverage Details

1 module Spec
2   module Example
3     class SharedExampleGroup < Module
4       module ClassMethods
5         def register(*args, &block)
6           new_example_group = new(*args, &block)
7           shared_example_groups << new_example_group unless already_registered?(new_example_group)
8           new_example_group
9         end
10 
11         def find(example_group_description)
12           shared_example_groups.find {|b| b.description == example_group_description}
13         end
14 
15         def clear
16           shared_example_groups.clear
17         end
18 
19         def include?(group)
20           shared_example_groups.include?(group)
21         end
22 
23         def count
24           shared_example_groups.length
25         end
26 
27       private
28 
29         def shared_example_groups
30           @shared_example_groups ||= []
31         end
32 
33         def already_registered?(new_example_group)
34           existing_example_group = find(new_example_group.description)
35           return false unless existing_example_group
36           return true if new_example_group.equal?(existing_example_group)
37           return true if expanded_path(new_example_group) == expanded_path(existing_example_group)
38           raise ArgumentError.new("Shared Example '#{existing_example_group.description}' already exists")
39         end
40 
41         def expanded_path(example_group)
42           File.expand_path(example_group.location)
43         end
44       end
45 
46       extend ClassMethods
47       include ExampleGroupMethods
48 
49       def initialize(*args, &example_group_block)
50         set_description(*args)
51         @example_group_block = example_group_block
52       end
53 
54       def included(mod) # :nodoc:
55         mod.module_eval(&@example_group_block)
56       end
57     end
58   end
59 end

Generated on Mon May 10 23:40:27 -0700 2010 with rcov 0.9.8