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.
Name Total lines Lines of code Total coverage Code coverage
lib/spec/runner/extensions/kernel.rb 50 27
100.0% 
100.0% 
 1 module Kernel
 2   # Creates and registers an instance of a Spec::DSL::Behaviour (or a subclass).
 3   # The instantiated behaviour class depends on the directory of the file
 4   # calling this method. For example, Spec::Rails will use different
 5   # classes for specs living in <tt>spec/models</tt>, <tt>spec/helpers</tt>, 
 6   # <tt>spec/views</tt> and <tt>spec/controllers</tt>.
 7   #
 8   # It is also possible to override autodiscovery of the behaviour class 
 9   # with an options Hash as the last argument:
10   #
11   #   describe "name", :behaviour_type => :something_special do ...
12   #
13   # The reason for using different behaviour classes is to have
14   # different matcher methods available from within the <tt>describe</tt>
15   # block.
16   #
17   # See Spec::DSL::BehaviourFactory#add_behaviour_class for details about 
18   # how to register special Spec::DSL::Behaviour implementations.
19   #
20   def describe(*args, &block)
21     raise ArgumentError if args.empty?
22     args << {} unless Hash === args.last
23     args.last[:spec_path] = caller(0)[1]
24     register_behaviour(Spec::DSL::BehaviourFactory.create(*args, &block))
25   end
26   alias :context :describe
27   
28   def respond_to(*names)
29     Spec::Matchers::RespondTo.new(*names)
30   end
31   
32 private
33 
34   def register_behaviour(behaviour)
35     if behaviour.shared?
36       Spec::DSL::Behaviour.add_shared_behaviour(behaviour)
37     else
38       behaviour_runner.add_behaviour(behaviour)
39     end
40   end
41 
42   def behaviour_runner
43     # TODO: Figure out a better way to get this considered "covered" and keep this statement on multiple lines 
44     unless $behaviour_runner; \
45       $behaviour_runner = ::Spec::Runner::OptionParser.new.create_behaviour_runner(ARGV.dup, STDERR, STDOUT, false); \
46       at_exit { $behaviour_runner.run(nil, false) }; \
47     end
48     $behaviour_runner
49   end
50 end

Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.

Valid XHTML 1.0! Valid CSS!