Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/example/module_reopening_fix.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/module_reopening_fix.rb 43 18
100.00%
100.00%

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     # When you reopen a module that is included in another module that is included in a class,
4     # the new material you define does not make it to the class. This fixes that.
5     #
6     # == Example
7     #
8     #   module M1; end
9     #
10     #   module M2
11     #     def foo; "FOO"; end
12     #   end
13     #
14     #   class C
15     #     include M1
16     #   end
17     #
18     #   module M1
19     #     include M2
20     #   end
21     #
22     #   c = C.new
23     #   c.foo
24     #   NoMethodError: undefined method `foo' for #<C:0x5e89a4>
25     #     from (irb):12
26     module ModuleReopeningFix
27       def child_modules
28         @child_modules ||= []
29       end
30 
31       def included(mod)
32         child_modules << mod
33       end
34 
35       def include(mod)
36         super
37         child_modules.each do |child_module|
38           child_module.__send__(:include, mod)
39         end
40       end
41     end
42   end
43 end

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