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.
1 require 'spec/runner/formatter'
2 require 'spec/runner/behaviour_runner'
3 require 'spec/runner/options'
4 require 'spec/runner/option_parser'
5 require 'spec/runner/command_line'
6 require 'spec/runner/drb_command_line'
7 require 'spec/runner/backtrace_tweaker'
8 require 'spec/runner/reporter'
9 require 'spec/runner/extensions/object'
10 require 'spec/runner/extensions/kernel'
11 require 'spec/runner/spec_parser'
12
13 module Spec
14 # == Behaviours and Examples
15 #
16 # Rather than expressing examples in classes, RSpec uses a custom domain specific language to
17 # describe Behaviours and Examples of those behaviours.
18 #
19 # A Behaviour is the equivalent of a fixture in xUnit-speak. It is a metaphor for the context
20 # in which you will run your executable example - a set of known objects in a known starting state.
21 # We begin be describing
22 #
23 # describe Account do
24 #
25 # before do
26 # @account = Account.new
27 # end
28 #
29 # it "should have a balance of $0" do
30 # @account.balance.should == Money.new(0, :dollars)
31 # end
32 #
33 # end
34 #
35 # We use the before block to set up the Behaviour (given), and then the #it method to
36 # hold the example code that expresses the event (when) and the expected outcome (then).
37 #
38 # == Helper Methods
39 #
40 # A primary goal of RSpec is to keep the examples clear. We therefore prefer
41 # less indirection than you might see in xUnit examples and in well factored, DRY production code. We feel
42 # that duplication is OK if removing it makes it harder to understand an example without
43 # having to look elsewhere to understand its context.
44 #
45 # That said, RSpec does support some level of encapsulating common code in helper
46 # methods that can exist within a context or within an included module.
47 #
48 # == Setup and Teardown
49 #
50 # You can use before and after within a Behaviour. Both methods take an optional
51 # scope argument so you can run the block before :each example or before :all examples
52 #
53 # describe "..." do
54 # before :all do
55 # ...
56 # end
57 #
58 # before :each do
59 # ...
60 # end
61 #
62 # it "should do something" do
63 # ...
64 # end
65 #
66 # it "should do something else" do
67 # ...
68 # end
69 #
70 # after :each do
71 # ...
72 # end
73 #
74 # after :all do
75 # ...
76 # end
77 #
78 # end
79 #
80 # The <tt>before :each</tt> block will run before each of the examples, once for each example. Likewise,
81 # the <tt>after :each</tt> block will run after each of the examples.
82 #
83 # It is also possible to specify a <tt>before :all</tt> and <tt>after :all</tt>
84 # block that will run only once for each behaviour, respectively before the first <code>before :each</code>
85 # and after the last <code>after :each</code>. The use of these is generally discouraged, because it
86 # introduces dependencies between the examples. Still, it might prove useful for very expensive operations
87 # if you know what you are doing.
88 #
89 # == Local helper methods
90 #
91 # You can include local helper methods by simply expressing them within a context:
92 #
93 # describe "..." do
94 #
95 # it "..." do
96 # helper_method
97 # end
98 #
99 # def helper_method
100 # ...
101 # end
102 #
103 # end
104 #
105 # == Included helper methods
106 #
107 # You can include helper methods in multiple contexts by expressing them within
108 # a module, and then including that module in your context:
109 #
110 # module AccountExampleHelperMethods
111 # def helper_method
112 # ...
113 # end
114 # end
115 #
116 # describe "A new account" do
117 # include AccountExampleHelperMethods
118 # before do
119 # @account = Account.new
120 # end
121 #
122 # it "should have a balance of $0" do
123 # helper_method
124 # @account.balance.should eql(Money.new(0, :dollars))
125 # end
126 # end
127 #
128 # == Shared behaviour
129 #
130 # You can define a shared behaviour, that may be used on other behaviours
131 #
132 # describe "All Editions", :shared => true do
133 # it "all editions behaviour" ...
134 # end
135 #
136 # describe SmallEdition do
137 # it_should_behave_like "All Editions"
138 #
139 # it "should do small edition stuff" do
140 # ...
141 # end
142 # end
143 module Runner
144 class << self
145 def configuration # :nodoc:
146 @configuration ||= Spec::DSL::Configuration.new
147 end
148
149 # Use this to configure various configurable aspects of
150 # RSpec:
151 #
152 # Spec::Runner.configure do |configuration|
153 # # Configure RSpec here
154 # end
155 #
156 # The yielded <tt>configuration</tt> object is a
157 # Spec::DSL::Configuration instance. See its RDoc
158 # for details about what you can do with it.
159 #
160 def configure
161 yield configuration if @configuration.nil?
162 end
163 end
164 end
165 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.