Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/dsl/main.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/dsl/main.rb 92 31
82.61%
48.39%

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 DSL
3     module Main
4       include Spec::Example::ArgsAndOptions
5 
6       # Creates and returns a class that includes the ExampleGroupMethods
7       # module. Which ExampleGroup type is created depends on the directory of the file
8       # calling this method. For example, Spec::Rails will use different
9       # classes for specs living in <tt>spec/models</tt>,
10       # <tt>spec/helpers</tt>, <tt>spec/views</tt> and
11       # <tt>spec/controllers</tt>.
12       #
13       # It is also possible to override autodiscovery of the example group
14       # type with an options Hash as the last argument:
15       #
16       #   describe "name", :type => :something_special do ...
17       #
18       # The reason for using different example group classes is to have different
19       # matcher methods available from within the <tt>describe</tt> block.
20       #
21       # See Spec::Example::ExampleGroupFactory#register for details about how to
22       # register special implementations.
23       #
24       def describe(*args, &block)
25         raise Spec::Example::NoDescriptionError.new("example group", caller(0)[1]) if args.empty?
26         add_options(args, :scope => self)
27         set_location(args.options, caller(0)[1])
28         Spec::Example::ExampleGroupFactory.create_example_group(*args, &block)
29       end
30       alias :context :describe unless defined?(IRB::Context)
31 
32       # Creates an example group that can be shared by other example groups
33       #
34       # == Examples
35       #
36       #  share_examples_for "All Editions" do
37       #    it "all editions behaviour" ...
38       #  end
39       #
40       #  describe SmallEdition do
41       #    it_should_behave_like "All Editions"
42       #
43       #    it "should do small edition stuff" do
44       #      ...
45       #    end
46       #  end
47       def share_examples_for(*args, &block)
48         add_options(args)
49         set_location(args.options, caller(0)[1])
50         Spec::Example::ExampleGroupFactory.create_shared_example_group(*args, &block)
51       end
52       alias :shared_examples_for :share_examples_for
53 
54       # Creates a Shared Example Group and assigns it to a constant
55       #
56       #  share_as :AllEditions do
57       #    it "should do all editions stuff" ...
58       #  end
59       #
60       #  describe SmallEdition do
61       #    it_should_behave_like AllEditions
62       #
63       #    it "should do small edition stuff" do
64       #      ...
65       #    end
66       #  end
67       #
68       # And, for those of you who prefer to use something more like Ruby, you
69       # can just include the module directly
70       #
71       #  describe SmallEdition do
72       #    include AllEditions
73       #
74       #    it "should do small edition stuff" do
75       #      ...
76       #    end
77       #  end
78       def share_as(name, &block)
79         begin
80           args = [name]
81           add_options(args)
82           set_location(args.options, caller(0)[1])
83           Object.const_set(name, Spec::Example::ExampleGroupFactory.create_shared_example_group(*args, &block))
84         rescue NameError => e
85           raise NameError.new(e.message + "\nThe first argument to share_as must be a legal name for a constant\n")
86         end
87       end
88     end
89   end
90 end
91 
92 include Spec::DSL::Main

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