Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/example/example_group_factory.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/example_group_factory.rb 82 55
86.59%
81.82%

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 
4     class ExampleGroupFactory
5       module ClassMethods
6         include Spec::Example::ArgsAndOptions
7 
8         def reset
9           @example_group_types = nil
10           default(ExampleGroup)
11         end
12 
13         def example_group_creation_listeners
14           @example_group_creation_listeners ||= []
15         end
16 
17         def register_example_group(klass)
18           example_group_creation_listeners.each do |listener|
19             listener.register_example_group(klass)
20           end
21         end
22 
23         def create_shared_example_group(*args, &example_group_block) # :nodoc:
24           ::Spec::Example::SharedExampleGroup.register(*args, &example_group_block)
25         end
26 
27         def create_example_group(*args, &block)
28           raise ArgumentError if args.empty? || block.nil?
29           add_options(args)
30           superclass = determine_superclass(args.last)
31           superclass.describe(*args, &block)
32         end
33 
34         # Registers an example group class +klass+ with the symbol +type+. For
35         # example:
36         #
37         #   Spec::Example::ExampleGroupFactory.register(:farm, FarmExampleGroup)
38         #
39         # With that you can append a hash with :type => :farm to the describe
40         # method and it will load an instance of FarmExampleGroup.
41         #
42         #   describe Pig, :type => :farm do
43         #     ...
44         #
45         # If you don't use the hash explicitly, <tt>describe</tt> will
46         # implicitly use an instance of FarmExampleGroup for any file loaded
47         # from the <tt>./spec/farm</tt> directory.
48         def register(key, example_group_class)
49           @example_group_types[key.to_sym] = example_group_class
50         end
51 
52         # Sets the default ExampleGroup class
53         def default(example_group_class)
54           Spec.__send__ :remove_const, :ExampleGroup if Spec.const_defined?(:ExampleGroup)
55           Spec.const_set(:ExampleGroup, example_group_class)
56           old = @example_group_types
57           @example_group_types = Hash.new(example_group_class)
58           @example_group_types.merge!(old) if old
59         end
60 
61         def [](key)
62           @example_group_types[key]
63         end
64 
65       protected
66 
67         def determine_superclass(opts)
68           if type = opts[:type]
69             self[type]
70           elsif opts[:location] =~ /spec(\\|\/)(#{@example_group_types.keys.sort_by{|k| k.to_s.length}.reverse.join('|')})/
71             self[$2 == '' ? nil : $2.to_sym]
72           else
73             self[nil]
74           end
75         end
76 
77       end
78       extend ClassMethods
79       self.reset
80     end
81   end
82 end

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