Skip to content
This repository
Browse code

No need to commit docs anymore now we are publishing with scp.

  • Loading branch information...
commit bae7108fad1f437a9674434215afa03e7f509a4e 1 parent 8f1fb1a
James Mead authored May 04, 2012

Showing 56 changed files with 1 addition and 16,418 deletions. Show diff stats Hide diff stats

  1. 1  .gitignore
  2. 0  doc/.nojekyll
  3. 112  doc/Mocha.html
  4. 898  doc/Mocha/API.html
  5. 246  doc/Mocha/ClassMethods.html
  6. 471  doc/Mocha/Configuration.html
  7. 2,570  doc/Mocha/Expectation.html
  8. 830  doc/Mocha/Mock.html
  9. 668  doc/Mocha/ObjectMethods.html
  10. 2,715  doc/Mocha/ParameterMatchers.html
  11. 137  doc/Mocha/ParameterMatchers/AllOf.html
  12. 137  doc/Mocha/ParameterMatchers/AnyOf.html
  13. 136  doc/Mocha/ParameterMatchers/AnyParameters.html
  14. 136  doc/Mocha/ParameterMatchers/Anything.html
  15. 419  doc/Mocha/ParameterMatchers/Base.html
  16. 137  doc/Mocha/ParameterMatchers/Equals.html
  17. 137  doc/Mocha/ParameterMatchers/HasEntries.html
  18. 137  doc/Mocha/ParameterMatchers/HasEntry.html
  19. 137  doc/Mocha/ParameterMatchers/HasKey.html
  20. 137  doc/Mocha/ParameterMatchers/HasValue.html
  21. 137  doc/Mocha/ParameterMatchers/Includes.html
  22. 137  doc/Mocha/ParameterMatchers/InstanceOf.html
  23. 136  doc/Mocha/ParameterMatchers/IsA.html
  24. 137  doc/Mocha/ParameterMatchers/KindOf.html
  25. 137  doc/Mocha/ParameterMatchers/Not.html
  26. 136  doc/Mocha/ParameterMatchers/Optionally.html
  27. 136  doc/Mocha/ParameterMatchers/QueryStringMatches.html
  28. 137  doc/Mocha/ParameterMatchers/RegexpMatches.html
  29. 137  doc/Mocha/ParameterMatchers/RespondsWith.html
  30. 137  doc/Mocha/ParameterMatchers/YamlEquivalent.html
  31. 133  doc/Mocha/Sequence.html
  32. 510  doc/Mocha/StateMachine.html
  33. 125  doc/Mocha/StateMachine/State.html
  34. 125  doc/Mocha/StateMachine/StatePredicate.html
  35. 134  doc/Mocha/StubbingError.html
  36. 124  doc/Mocha/UnexpectedInvocation.html
  37. 481  doc/_index.html
  38. 47  doc/class_list.html
  39. 1  doc/css/common.css
  40. 55  doc/css/full_list.css
  41. 322  doc/css/style.css
  42. 72  doc/file.COPYING.html
  43. 86  doc/file.MIT-LICENSE.html
  44. 153  doc/file.README.html
  45. 954  doc/file.RELEASE.html
  46. 108  doc/file.misc.html
  47. 90  doc/file.mocha.html
  48. 129  doc/file.stubba.html
  49. 67  doc/file_list.html
  50. 13  doc/frames.html
  51. 153  doc/index.html
  52. 205  doc/js/app.js
  53. 173  doc/js/full_list.js
  54. 16  doc/js/jquery.js
  55. 510  doc/method_list.html
  56. 105  doc/top-level-namespace.html
1  .gitignore
... ...
@@ -1,5 +1,6 @@
1 1
 TODO
2 2
 Gemfile*.lock
  3
+doc
3 4
 pkg
4 5
 templates
5 6
 agiledox.txt
0  doc/.nojekyll
No changes.
112  doc/Mocha.html
... ...
@@ -1,112 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3  
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4  
-  <head>
5  
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6  
-<title>
7  
-  Module: Mocha
8  
-  
9  
-    &mdash; Mocha 0.11.3
10  
-  
11  
-</title>
12  
-
13  
-  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14  
-
15  
-  <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16  
-
17  
-<script type="text/javascript" charset="utf-8">
18  
-  relpath = '';
19  
-  if (relpath != '') relpath += '/';
20  
-</script>
21  
-
22  
-  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23  
-
24  
-  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25  
-
26  
-
27  
-  </head>
28  
-  <body>
29  
-    <script type="text/javascript" charset="utf-8">
30  
-      if (window.top.frames.main) document.body.className = 'frames';
31  
-    </script>
32  
-    
33  
-    <div id="header">
34  
-      <div id="menu">
35  
-  
36  
-    <a href="_index.html">Index (M)</a> &raquo; 
37  
-    
38  
-    
39  
-    <span class="title">Mocha</span>
40  
-  
41  
-  
42  
-  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43  
-</div>
44  
-
45  
-      <div id="search">
46  
-  
47  
-    <a id="class_list_link" href="#">Class List</a>
48  
-  
49  
-    <a id="method_list_link" href="#">Method List</a>
50  
-  
51  
-    <a id="file_list_link" href="#">File List</a>
52  
-  
53  
-</div>
54  
-      <div class="clear"></div>
55  
-    </div>
56  
-    
57  
-    <iframe id="search_frame"></iframe>
58  
-    
59  
-    <div id="content"><h1>Module: Mocha
60  
-  
61  
-  
62  
-  
63  
-</h1>
64  
-
65  
-<dl class="box">
66  
-  
67  
-  
68  
-    
69  
-  
70  
-    
71  
-  
72  
-  
73  
-  
74  
-    <dt class="r1 last">Defined in:</dt>
75  
-    <dd class="r1 last">lib/mocha/api.rb<span class="defines">,<br />
76  
-  lib/mocha/mock.rb,<br /> lib/mocha/object.rb,<br /> lib/mocha/sequence.rb,<br /> lib/mocha/expectation.rb,<br /> lib/mocha/configuration.rb,<br /> lib/mocha/state_machine.rb,<br /> lib/mocha/stubbing_error.rb,<br /> lib/mocha/parameter_matchers.rb,<br /> lib/mocha/unexpected_invocation.rb,<br /> lib/mocha/parameter_matchers/not.rb,<br /> lib/mocha/parameter_matchers/base.rb,<br /> lib/mocha/parameter_matchers/is_a.rb,<br /> lib/mocha/parameter_matchers/any_of.rb,<br /> lib/mocha/parameter_matchers/all_of.rb,<br /> lib/mocha/parameter_matchers/equals.rb,<br /> lib/mocha/parameter_matchers/object.rb,<br /> lib/mocha/parameter_matchers/has_key.rb,<br /> lib/mocha/parameter_matchers/kind_of.rb,<br /> lib/mocha/parameter_matchers/includes.rb,<br /> lib/mocha/parameter_matchers/anything.rb,<br /> lib/mocha/parameter_matchers/has_value.rb,<br /> lib/mocha/parameter_matchers/has_entry.rb,<br /> lib/mocha/parameter_matchers/optionally.rb,<br /> lib/mocha/parameter_matchers/has_entries.rb,<br /> lib/mocha/parameter_matchers/instance_of.rb,<br /> lib/mocha/parameter_matchers/query_string.rb,<br /> lib/mocha/parameter_matchers/responds_with.rb,<br /> lib/mocha/parameter_matchers/any_parameters.rb,<br /> lib/mocha/parameter_matchers/regexp_matches.rb,<br /> lib/mocha/parameter_matchers/yaml_equivalent.rb</span>
77  
-</dd>
78  
-  
79  
-</dl>
80  
-<div class="clear"></div>
81  
-
82  
-<h2>Defined Under Namespace</h2>
83  
-<p class="children">
84  
-   
85  
-    
86  
-      <strong class="modules">Modules:</strong> <span class='object_link'><a href="Mocha/API.html" title="Mocha::API (module)">API</a></span>, <span class='object_link'><a href="Mocha/ClassMethods.html" title="Mocha::ClassMethods (module)">ClassMethods</a></span>, <span class='object_link'><a href="Mocha/ObjectMethods.html" title="Mocha::ObjectMethods (module)">ObjectMethods</a></span>, <span class='object_link'><a href="Mocha/ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span>
87  
-    
88  
-   
89  
-    
90  
-      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Mocha/Configuration.html" title="Mocha::Configuration (class)">Configuration</a></span>, <span class='object_link'><a href="Mocha/Expectation.html" title="Mocha::Expectation (class)">Expectation</a></span>, <span class='object_link'><a href="Mocha/Mock.html" title="Mocha::Mock (class)">Mock</a></span>, <span class='object_link'><a href="Mocha/Sequence.html" title="Mocha::Sequence (class)">Sequence</a></span>, <span class='object_link'><a href="Mocha/StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span>, <span class='object_link'><a href="Mocha/StubbingError.html" title="Mocha::StubbingError (class)">StubbingError</a></span>, <span class='object_link'><a href="Mocha/UnexpectedInvocation.html" title="Mocha::UnexpectedInvocation (class)">UnexpectedInvocation</a></span>
91  
-    
92  
-  
93  
-</p>
94  
-
95  
-
96  
-
97  
-
98  
-
99  
-
100  
-
101  
-
102  
-
103  
-</div>
104  
-    
105  
-    <div id="footer">
106  
-  Generated on Wed Apr 25 16:51:30 2012 by 
107  
-  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108  
-  0.7.5 (ruby-1.9.3).
109  
-</div>
110  
-
111  
-  </body>
112  
-</html>
898  doc/Mocha/API.html
... ...
@@ -1,898 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3  
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4  
-  <head>
5  
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6  
-<title>
7  
-  Module: Mocha::API
8  
-  
9  
-    &mdash; Mocha 0.11.3
10  
-  
11  
-</title>
12  
-
13  
-  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14  
-
15  
-  <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16  
-
17  
-<script type="text/javascript" charset="utf-8">
18  
-  relpath = '..';
19  
-  if (relpath != '') relpath += '/';
20  
-</script>
21  
-
22  
-  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23  
-
24  
-  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25  
-
26  
-
27  
-  </head>
28  
-  <body>
29  
-    <script type="text/javascript" charset="utf-8">
30  
-      if (window.top.frames.main) document.body.className = 'frames';
31  
-    </script>
32  
-    
33  
-    <div id="header">
34  
-      <div id="menu">
35  
-  
36  
-    <a href="../_index.html">Index (A)</a> &raquo; 
37  
-    <span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
38  
-     &raquo; 
39  
-    <span class="title">API</span>
40  
-  
41  
-  
42  
-  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43  
-</div>
44  
-
45  
-      <div id="search">
46  
-  
47  
-    <a id="class_list_link" href="#">Class List</a>
48  
-  
49  
-    <a id="method_list_link" href="#">Method List</a>
50  
-  
51  
-    <a id="file_list_link" href="#">File List</a>
52  
-  
53  
-</div>
54  
-      <div class="clear"></div>
55  
-    </div>
56  
-    
57  
-    <iframe id="search_frame"></iframe>
58  
-    
59  
-    <div id="content"><h1>Module: Mocha::API
60  
-  
61  
-  
62  
-  
63  
-</h1>
64  
-
65  
-<dl class="box">
66  
-  
67  
-  
68  
-    
69  
-  
70  
-    
71  
-      <dt class="r1">Includes:</dt>
72  
-      <dd class="r1"><span class='object_link'><a href="ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span></dd>
73  
-      
74  
-    
75  
-  
76  
-  
77  
-  
78  
-    <dt class="r2 last">Defined in:</dt>
79  
-    <dd class="r2 last">lib/mocha/api.rb</dd>
80  
-  
81  
-</dl>
82  
-<div class="clear"></div>
83  
-
84  
-<h2>Overview</h2><div class="docstring">
85  
-  <div class="discussion">
86  
-    
87  
-<p>Methods added to <tt>Test::Unit::TestCase</tt> or equivalent.</p>
88  
-
89  
-
90  
-  </div>
91  
-</div>
92  
-<div class="tags">
93  
-  
94  
-
95  
-</div>
96  
-
97  
-
98  
-
99  
-
100  
-
101  
-
102  
-  
103  
-    <h2>
104  
-      Instance Method Summary
105  
-      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
106  
-    </h2>
107  
-
108  
-    <ul class="summary">
109  
-      
110  
-        <li class="public ">
111  
-  <span class="summary_signature">
112  
-    
113  
-      <a href="#mock-instance_method" title="#mock (instance method)">- (Mock) <strong>mock</strong>(*arguments) { ... }</a>
114  
-    
115  
-
116  
-    
117  
-  </span>
118  
-  
119  
-  
120  
-  
121  
-  
122  
-  
123  
-  
124  
-
125  
-  
126  
-    <span class="summary_desc"><div class='inline'>
127  
-<p>Builds a new mock object.</p>
128  
-</div></span>
129  
-  
130  
-</li>
131  
-
132  
-      
133  
-        <li class="public ">
134  
-  <span class="summary_signature">
135  
-    
136  
-      <a href="#sequence-instance_method" title="#sequence (instance method)">- (Sequence) <strong>sequence</strong>(name) </a>
137  
-    
138  
-
139  
-    
140  
-  </span>
141  
-  
142  
-  
143  
-  
144  
-  
145  
-  
146  
-  
147  
-
148  
-  
149  
-    <span class="summary_desc"><div class='inline'>
150  
-<p>Builds a new sequence which can be used to constrain the order in which
151  
-expectations can occur.</p>
152  
-</div></span>
153  
-  
154  
-</li>
155  
-
156  
-      
157  
-        <li class="public ">
158  
-  <span class="summary_signature">
159  
-    
160  
-      <a href="#states-instance_method" title="#states (instance method)">- (StateMachine) <strong>states</strong>(name) </a>
161  
-    
162  
-
163  
-    
164  
-  </span>
165  
-  
166  
-  
167  
-  
168  
-  
169  
-  
170  
-  
171  
-
172  
-  
173  
-    <span class="summary_desc"><div class='inline'>
174  
-<p>Builds a new state machine which can be used to constrain the order in
175  
-which expectations can occur.</p>
176  
-</div></span>
177  
-  
178  
-</li>
179  
-
180  
-      
181  
-        <li class="public ">
182  
-  <span class="summary_signature">
183  
-    
184  
-      <a href="#stub-instance_method" title="#stub (instance method)">- (Mock) <strong>stub</strong>(*arguments) { ... }</a>
185  
-    
186  
-
187  
-    
188  
-  </span>
189  
-  
190  
-  
191  
-  
192  
-  
193  
-  
194  
-  
195  
-
196  
-  
197  
-    <span class="summary_desc"><div class='inline'>
198  
-<p>Builds a new mock object.</p>
199  
-</div></span>
200  
-  
201  
-</li>
202  
-
203  
-      
204  
-        <li class="public ">
205  
-  <span class="summary_signature">
206  
-    
207  
-      <a href="#stub_everything-instance_method" title="#stub_everything (instance method)">- (Mock) <strong>stub_everything</strong>(*arguments) { ... }</a>
208  
-    
209  
-
210  
-    
211  
-  </span>
212  
-  
213  
-  
214  
-  
215  
-  
216  
-  
217  
-  
218  
-
219  
-  
220  
-    <span class="summary_desc"><div class='inline'>
221  
-<p>Builds a mock object that accepts calls to any method.</p>
222  
-</div></span>
223  
-  
224  
-</li>
225  
-
226  
-      
227  
-    </ul>
228  
-  
229  
-
230  
-
231  
-  
232  
-  
233  
-  
234  
-  
235  
-  
236  
-  
237  
-  
238  
-  <h3 class="inherited">Methods included from <span class='object_link'><a href="ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span></h3>
239  
-  <p class="inherited"><span class='object_link'><a href="ParameterMatchers.html#Not-instance_method" title="Mocha::ParameterMatchers#Not (method)">#Not</a></span>, <span class='object_link'><a href="ParameterMatchers.html#all_of-instance_method" title="Mocha::ParameterMatchers#all_of (method)">#all_of</a></span>, <span class='object_link'><a href="ParameterMatchers.html#any_of-instance_method" title="Mocha::ParameterMatchers#any_of (method)">#any_of</a></span>, <span class='object_link'><a href="ParameterMatchers.html#any_parameters-instance_method" title="Mocha::ParameterMatchers#any_parameters (method)">#any_parameters</a></span>, <span class='object_link'><a href="ParameterMatchers.html#anything-instance_method" title="Mocha::ParameterMatchers#anything (method)">#anything</a></span>, <span class='object_link'><a href="ParameterMatchers.html#equals-instance_method" title="Mocha::ParameterMatchers#equals (method)">#equals</a></span>, <span class='object_link'><a href="ParameterMatchers.html#has_entries-instance_method" title="Mocha::ParameterMatchers#has_entries (method)">#has_entries</a></span>, <span class='object_link'><a href="ParameterMatchers.html#has_entry-instance_method" title="Mocha::ParameterMatchers#has_entry (method)">#has_entry</a></span>, <span class='object_link'><a href="ParameterMatchers.html#has_equivalent_query_string-instance_method" title="Mocha::ParameterMatchers#has_equivalent_query_string (method)">#has_equivalent_query_string</a></span>, <span class='object_link'><a href="ParameterMatchers.html#has_key-instance_method" title="Mocha::ParameterMatchers#has_key (method)">#has_key</a></span>, <span class='object_link'><a href="ParameterMatchers.html#has_value-instance_method" title="Mocha::ParameterMatchers#has_value (method)">#has_value</a></span>, <span class='object_link'><a href="ParameterMatchers.html#includes-instance_method" title="Mocha::ParameterMatchers#includes (method)">#includes</a></span>, <span class='object_link'><a href="ParameterMatchers.html#instance_of-instance_method" title="Mocha::ParameterMatchers#instance_of (method)">#instance_of</a></span>, <span class='object_link'><a href="ParameterMatchers.html#is_a-instance_method" title="Mocha::ParameterMatchers#is_a (method)">#is_a</a></span>, <span class='object_link'><a href="ParameterMatchers.html#kind_of-instance_method" title="Mocha::ParameterMatchers#kind_of (method)">#kind_of</a></span>, <span class='object_link'><a href="ParameterMatchers.html#optionally-instance_method" title="Mocha::ParameterMatchers#optionally (method)">#optionally</a></span>, <span class='object_link'><a href="ParameterMatchers.html#regexp_matches-instance_method" title="Mocha::ParameterMatchers#regexp_matches (method)">#regexp_matches</a></span>, <span class='object_link'><a href="ParameterMatchers.html#responds_with-instance_method" title="Mocha::ParameterMatchers#responds_with (method)">#responds_with</a></span>, <span class='object_link'><a href="ParameterMatchers.html#yaml_equivalent-instance_method" title="Mocha::ParameterMatchers#yaml_equivalent (method)">#yaml_equivalent</a></span></p>
240  
-
241  
-
242  
-  <div id="instance_method_details" class="method_details_list">
243  
-    <h2>Instance Method Details</h2>
244  
-    
245  
-    
246  
-      <div class="method_details first">
247  
-  <p class="signature first" id="mock-instance_method">
248  
-  
249  
-    
250  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>mock</strong>(name, &amp;block) </span>
251  
-    
252  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>mock</strong>(expected_methods_vs_return_values = {}, &amp;block) </span>
253  
-    
254  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>mock</strong>(name, expected_methods_vs_return_values = {}, &amp;block) </span>
255  
-    
256  
-  
257  
-
258  
-  
259  
-</p><div class="docstring">
260  
-  <div class="discussion">
261  
-    
262  
-<p>Builds a new mock object</p>
263  
-
264  
-
265  
-  </div>
266  
-</div>
267  
-<div class="tags">
268  
-  
269  
-  <div class="examples">
270  
-    <h3>Examples:</h3>
271  
-    
272  
-      <h4><div class='inline'>
273  
-<p>Using expected_methods_vs_return_values Hash to setup expectations.</p>
274  
-</div></h4>
275  
-      <pre class="example code"><span class='kw'>def</span> <span class='id identifier rubyid_test_motor_starts_and_stops'>test_motor_starts_and_stops</span>
276  
-  <span class='id identifier rubyid_motor'>motor</span> <span class='op'>=</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>motor</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:start</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:stop</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='rparen'>)</span>
277  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
278  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span>
279  
-  <span class='comment'># an error will be raised unless both Motor#start and Motor#stop have been called
280  
-</span><span class='kw'>end</span></pre>
281  
-    
282  
-      <h4><div class='inline'>
283  
-<p>Using the optional block to setup expectations &amp; stubbed methods.</p>
284  
-</div></h4>
285  
-      <pre class="example code"><span class='kw'>def</span> <span class='id identifier rubyid_test_motor_starts_and_stops'>test_motor_starts_and_stops</span>
286  
-  <span class='id identifier rubyid_motor'>motor</span> <span class='op'>=</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>motor</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
287  
-    <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:start</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='int'>100</span><span class='period'>.</span><span class='id identifier rubyid_rpm'>rpm</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_returns'>returns</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
288  
-    <span class='id identifier rubyid_stubs'>stubs</span><span class='lparen'>(</span><span class='symbol'>:stop</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_returns'>returns</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
289  
-  <span class='kw'>end</span>
290  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='int'>100</span><span class='period'>.</span><span class='id identifier rubyid_rpm'>rpm</span><span class='rparen'>)</span>
291  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span>
292  
-  <span class='comment'># an error will only be raised if Motor#start(100.rpm) has not been called
293  
-</span><span class='kw'>end</span></pre>
294  
-    
295  
-  </div>
296  
-<h3>Parameters:</h3>
297  
-<ul class="param">
298  
-  
299  
-    <li>
300  
-      
301  
-        <span class='name'>name</span>
302  
-      
303  
-      
304  
-        <span class='type'>(<tt>String</tt>)</span>
305  
-      
306  
-      
307  
-      
308  
-        &mdash;
309  
-        <div class='inline'>
310  
-<p>identifies mock object in error messages.</p>
311  
-</div>
312  
-      
313  
-    </li>
314  
-  
315  
-    <li>
316  
-      
317  
-        <span class='name'>expected_methods_vs_return_values</span>
318  
-      
319  
-      
320  
-        <span class='type'>(<tt>Hash</tt>)</span>
321  
-      
322  
-      
323  
-      
324  
-        &mdash;
325  
-        <div class='inline'>
326  
-<p>expected method name symbols as keys and corresponding return values as
327  
-values - these expectations are setup as if <span class='object_link'><a href="Mock.html#expects-instance_method" title="Mocha::Mock#expects (method)">Mock#expects</a></span> were called
328  
-multiple times.</p>
329  
-</div>
330  
-      
331  
-    </li>
332  
-  
333  
-</ul>
334  
-
335  
-<h3>Yields:</h3>
336  
-<ul class="yield">
337  
-  
338  
-    <li>
339  
-      
340  
-      
341  
-        <span class='type'></span>
342  
-      
343  
-      
344  
-      
345  
-        
346  
-        <div class='inline'>
347  
-<p>optional block to be evaluated against the mock object instance, giving an
348  
-alternative way to setup expectations.</p>
349  
-</div>
350  
-      
351  
-    </li>
352  
-  
353  
-</ul>
354  
-<h3>Returns:</h3>
355  
-<ul class="return">
356  
-  
357  
-    <li>
358  
-      
359  
-      
360  
-        <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
361  
-      
362  
-      
363  
-      
364  
-        &mdash;
365  
-        <div class='inline'>
366  
-<p>a new mock object</p>
367  
-</div>
368  
-      
369  
-    </li>
370  
-  
371  
-</ul>
372  
-
373  
-</div><table class="source_code">
374  
-  <tr>
375  
-    <td>
376  
-      <pre class="lines">
377  
-
378  
-
379  
-40
380  
-41
381  
-42
382  
-43
383  
-44
384  
-45
385  
-46</pre>
386  
-    </td>
387  
-    <td>
388  
-      <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 40</span>
389  
-
390  
-<span class='kw'>def</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
391  
-  <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='kw'>if</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
392  
-  <span class='id identifier rubyid_expectations'>expectations</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
393  
-  <span class='id identifier rubyid_mock'>mock</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>?</span> <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_named_mock'>named_mock</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_unnamed_mock'>unnamed_mock</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
394  
-  <span class='id identifier rubyid_mock'>mock</span><span class='period'>.</span><span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='id identifier rubyid_expectations'>expectations</span><span class='rparen'>)</span>
395  
-  <span class='id identifier rubyid_mock'>mock</span>
396  
-<span class='kw'>end</span></pre>
397  
-    </td>
398  
-  </tr>
399  
-</table>
400  
-</div>
401  
-    
402  
-      <div class="method_details ">
403  
-  <p class="signature " id="sequence-instance_method">
404  
-  
405  
-    - (<tt><span class='object_link'><a href="Sequence.html" title="Mocha::Sequence (class)">Sequence</a></span></tt>) <strong>sequence</strong>(name) 
406  
-  
407  
-
408  
-  
409  
-</p><div class="docstring">
410  
-  <div class="discussion">
411  
-    
412  
-<p>Builds a new sequence which can be used to constrain the order in which
413  
-expectations can occur.</p>
414  
-
415  
-<p>Specify that an expected invocation must occur within a named <span class='object_link'><a href="Sequence.html" title="Mocha::Sequence (class)">Sequence</a></span> by
416  
-using <span class='object_link'><a href="Expectation.html#in_sequence-instance_method" title="Mocha::Expectation#in_sequence (method)">Expectation#in_sequence</a></span>.</p>
417  
-
418  
-
419  
-  </div>
420  
-</div>
421  
-<div class="tags">
422  
-  
423  
-  <div class="examples">
424  
-    <h3>Examples:</h3>
425  
-    
426  
-      <h4><div class='inline'>
427  
-<p>Ensure methods on egg are invoked in correct order.</p>
428  
-</div></h4>
429  
-      <pre class="example code"><span class='id identifier rubyid_breakfast'>breakfast</span> <span class='op'>=</span> <span class='id identifier rubyid_sequence'>sequence</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>breakfast</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
430  
-
431  
-<span class='id identifier rubyid_egg'>egg</span> <span class='op'>=</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>egg</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
432  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:crack</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_in_sequence'>in_sequence</span><span class='lparen'>(</span><span class='id identifier rubyid_breakfast'>breakfast</span><span class='rparen'>)</span>
433  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:fry</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_in_sequence'>in_sequence</span><span class='lparen'>(</span><span class='id identifier rubyid_breakfast'>breakfast</span><span class='rparen'>)</span>
434  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:eat</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_in_sequence'>in_sequence</span><span class='lparen'>(</span><span class='id identifier rubyid_breakfast'>breakfast</span><span class='rparen'>)</span>
435  
-<span class='kw'>end</span></pre>
436  
-    
437  
-  </div>
438  
-
439  
-<h3>Returns:</h3>
440  
-<ul class="return">
441  
-  
442  
-    <li>
443  
-      
444  
-      
445  
-        <span class='type'>(<tt><span class='object_link'><a href="Sequence.html" title="Mocha::Sequence (class)">Sequence</a></span></tt>)</span>
446  
-      
447  
-      
448  
-      
449  
-        &mdash;
450  
-        <div class='inline'>
451  
-<p>a new sequence</p>
452  
-</div>
453  
-      
454  
-    </li>
455  
-  
456  
-</ul>
457  
-
458  
-  <h3>See Also:</h3>
459  
-  <ul class="see">
460  
-    
461  
-      <li><span class='object_link'><a href="Expectation.html#in_sequence-instance_method" title="Mocha::Expectation#in_sequence (method)">Expectation#in_sequence</a></span></li>
462  
-    
463  
-  </ul>
464  
-
465  
-</div><table class="source_code">
466  
-  <tr>
467  
-    <td>
468  
-      <pre class="lines">
469  
-
470  
-
471  
-128
472  
-129
473  
-130</pre>
474  
-    </td>
475  
-    <td>
476  
-      <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 128</span>
477  
-
478  
-<span class='kw'>def</span> <span class='id identifier rubyid_sequence'>sequence</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
479  
-  <span class='const'>Sequence</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
480  
-<span class='kw'>end</span></pre>
481  
-    </td>
482  
-  </tr>
483  
-</table>
484  
-</div>
485  
-    
486  
-      <div class="method_details ">
487  
-  <p class="signature " id="states-instance_method">
488  
-  
489  
-    - (<tt><span class='object_link'><a href="StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>) <strong>states</strong>(name) 
490  
-  
491  
-
492  
-  
493  
-</p><div class="docstring">
494  
-  <div class="discussion">
495  
-    
496  
-<p>Builds a new state machine which can be used to constrain the order in
497  
-which expectations can occur.</p>
498  
-
499  
-<p>Specify the initial state of the state machine by using
500  
-<span class='object_link'><a href="StateMachine.html#starts_as-instance_method" title="Mocha::StateMachine#starts_as (method)">StateMachine#starts_as</a></span>.</p>
501  
-
502  
-<p>Specify that an expected invocation should change the state of the state
503  
-machine by using <span class='object_link'><a href="Expectation.html#then-instance_method" title="Mocha::Expectation#then (method)">Expectation#then</a></span>.</p>
504  
-
505  
-<p>Specify that an expected invocation should be constrained to occur within a
506  
-particular <tt>state</tt> by using <span class='object_link'><a href="Expectation.html#when-instance_method" title="Mocha::Expectation#when (method)">Expectation#when</a></span>.</p>
507  
-
508  
-<p>A test can contain multiple state machines.</p>
509  
-
510  
-
511  
-  </div>
512  
-</div>
513  
-<div class="tags">
514  
-  
515  
-  <div class="examples">
516  
-    <h3>Examples:</h3>
517  
-    
518  
-      <h4><div class='inline'>
519  
-<p>Constrain expected invocations to occur in particular states.</p>
520  
-</div></h4>
521  
-      <pre class="example code"><span class='id identifier rubyid_power'>power</span> <span class='op'>=</span> <span class='id identifier rubyid_states'>states</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>power</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_starts_as'>starts_as</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>off</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
522  
-
523  
-<span class='id identifier rubyid_radio'>radio</span> <span class='op'>=</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>radio</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
524  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:switch_on</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_then'>then</span><span class='lparen'>(</span><span class='id identifier rubyid_power'>power</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>on</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
525  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:select_channel</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>BBC Radio 4</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_when'>when</span><span class='lparen'>(</span><span class='id identifier rubyid_power'>power</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>on</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
526  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:adjust_volume</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='int'>+5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_when'>when</span><span class='lparen'>(</span><span class='id identifier rubyid_power'>power</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>on</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
527  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:select_channel</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>BBC World Service</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_when'>when</span><span class='lparen'>(</span><span class='id identifier rubyid_power'>power</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>on</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
528  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:adjust_volume</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='op'>-</span><span class='int'>5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_when'>when</span><span class='lparen'>(</span><span class='id identifier rubyid_power'>power</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>on</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
529  
-  <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:switch_off</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_then'>then</span><span class='lparen'>(</span><span class='id identifier rubyid_power'>power</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>off</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
530  
-<span class='kw'>end</span></pre>
531  
-    
532  
-  </div>
533  
-
534  
-<h3>Returns:</h3>
535  
-<ul class="return">
536  
-  
537  
-    <li>
538  
-      
539  
-      
540  
-        <span class='type'>(<tt><span class='object_link'><a href="StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>)</span>
541  
-      
542  
-      
543  
-      
544  
-        &mdash;
545  
-        <div class='inline'>
546  
-<p>a new state machine</p>
547  
-</div>
548  
-      
549  
-    </li>
550  
-  
551  
-</ul>
552  
-
553  
-  <h3>See Also:</h3>
554  
-  <ul class="see">
555  
-    
556  
-      <li><span class='object_link'><a href="Expectation.html#then-instance_method" title="Mocha::Expectation#then (method)">Expectation#then</a></span></li>
557  
-    
558  
-      <li><span class='object_link'><a href="Expectation.html#when-instance_method" title="Mocha::Expectation#when (method)">Expectation#when</a></span></li>
559  
-    
560  
-      <li><span class='object_link'><a href="StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span></li>
561  
-    
562  
-  </ul>
563  
-
564  
-</div><table class="source_code">
565  
-  <tr>
566  
-    <td>
567  
-      <pre class="lines">
568  
-
569  
-
570  
-158
571  
-159
572  
-160</pre>
573  
-    </td>
574  
-    <td>
575  
-      <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 158</span>
576  
-
577  
-<span class='kw'>def</span> <span class='id identifier rubyid_states'>states</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
578  
-  <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_new_state_machine'>new_state_machine</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
579  
-<span class='kw'>end</span></pre>
580  
-    </td>
581  
-  </tr>
582  
-</table>
583  
-</div>
584  
-    
585  
-      <div class="method_details ">
586  
-  <p class="signature " id="stub-instance_method">
587  
-  
588  
-    
589  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>stub</strong>(name, &amp;block) </span>
590  
-    
591  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>stub</strong>(stubbed_methods_vs_return_values = {}, &amp;block) </span>
592  
-    
593  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>stub</strong>(name, stubbed_methods_vs_return_values = {}, &amp;block) </span>
594  
-    
595  
-  
596  
-
597  
-  
598  
-</p><div class="docstring">
599  
-  <div class="discussion">
600  
-    
601  
-<p>Builds a new mock object</p>
602  
-
603  
-
604  
-  </div>
605  
-</div>
606  
-<div class="tags">
607  
-  
608  
-  <div class="examples">
609  
-    <h3>Examples:</h3>
610  
-    
611  
-      <h4><div class='inline'>
612  
-<p>Using stubbed_methods_vs_return_values Hash to setup stubbed methods.</p>
613  
-</div></h4>
614  
-      <pre class="example code"><span class='kw'>def</span> <span class='id identifier rubyid_test_motor_starts_and_stops'>test_motor_starts_and_stops</span>
615  
-  <span class='id identifier rubyid_motor'>motor</span> <span class='op'>=</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>motor</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:start</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:stop</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='rparen'>)</span>
616  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
617  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span>
618  
-  <span class='comment'># an error will not be raised even if either Motor#start or Motor#stop has not been called
619  
-</span><span class='kw'>end</span></pre>
620  
-    
621  
-      <h4><div class='inline'>
622  
-<p>Using the optional block to setup expectations &amp; stubbed methods.</p>
623  
-</div></h4>
624  
-      <pre class="example code"><span class='kw'>def</span> <span class='id identifier rubyid_test_motor_starts_and_stops'>test_motor_starts_and_stops</span>
625  
-  <span class='id identifier rubyid_motor'>motor</span> <span class='op'>=</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>motor</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
626  
-    <span class='id identifier rubyid_expects'>expects</span><span class='lparen'>(</span><span class='symbol'>:start</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='int'>100</span><span class='period'>.</span><span class='id identifier rubyid_rpm'>rpm</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_returns'>returns</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
627  
-    <span class='id identifier rubyid_stubs'>stubs</span><span class='lparen'>(</span><span class='symbol'>:stop</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_returns'>returns</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
628  
-  <span class='kw'>end</span>
629  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='int'>100</span><span class='period'>.</span><span class='id identifier rubyid_rpm'>rpm</span><span class='rparen'>)</span>
630  
-  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span>
631  
-  <span class='comment'># an error will only be raised if Motor#start(100.rpm) has not been called
632  
-</span><span class='kw'>end</span></pre>
633  
-    
634  
-  </div>
635  
-<h3>Parameters:</h3>
636  
-<ul class="param">
637  
-  
638  
-    <li>
639  
-      
640  
-        <span class='name'>name</span>
641  
-      
642  
-      
643  
-        <span class='type'>(<tt>String</tt>)</span>
644  
-      
645  
-      
646  
-      
647  
-        &mdash;
648  
-        <div class='inline'>
649  
-<p>identifies mock object in error messages.</p>
650  
-</div>
651  
-      
652  
-    </li>
653  
-  
654  
-    <li>
655  
-      
656  
-        <span class='name'>stubbed_methods_vs_return_values</span>
657  
-      
658  
-      
659  
-        <span class='type'>(<tt>Hash</tt>)</span>
660  
-      
661  
-      
662  
-      
663  
-        &mdash;
664  
-        <div class='inline'>
665  
-<p>stubbed method name symbols as keys and corresponding return values as
666  
-values - these stubbed methods are setup as if <span class='object_link'><a href="Mock.html#stubs-instance_method" title="Mocha::Mock#stubs (method)">Mock#stubs</a></span> were called
667  
-multiple times.</p>
668  
-</div>
669  
-      
670  
-    </li>
671  
-  
672  
-</ul>
673  
-
674  
-<h3>Yields:</h3>
675  
-<ul class="yield">
676  
-  
677  
-    <li>
678  
-      
679  
-      
680  
-        <span class='type'></span>
681  
-      
682  
-      
683  
-      
684  
-        
685  
-        <div class='inline'>
686  
-<p>optional block to be evaluated against the mock object instance, giving an
687  
-alternative way to setup stubbed methods.</p>
688  
-</div>
689  
-      
690  
-    </li>
691  
-  
692  
-</ul>
693  
-<h3>Returns:</h3>
694  
-<ul class="return">
695  
-  
696  
-    <li>
697  
-      
698  
-      
699  
-        <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
700  
-      
701  
-      
702  
-      
703  
-        &mdash;
704  
-        <div class='inline'>
705  
-<p>a new mock object</p>
706  
-</div>
707  
-      
708  
-    </li>
709  
-  
710  
-</ul>
711  
-
712  
-</div><table class="source_code">
713  
-  <tr>
714  
-    <td>
715  
-      <pre class="lines">
716  
-
717  
-
718  
-77
719  
-78
720  
-79
721  
-80
722  
-81
723  
-82
724  
-83</pre>
725  
-    </td>
726  
-    <td>
727  
-      <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 77</span>
728  
-
729  
-<span class='kw'>def</span> <span class='id identifier rubyid_stub'>stub</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
730  
-  <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='kw'>if</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
731  
-  <span class='id identifier rubyid_expectations'>expectations</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
732  
-  <span class='id identifier rubyid_stub'>stub</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>?</span> <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_named_mock'>named_mock</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_unnamed_mock'>unnamed_mock</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
733  
-  <span class='id identifier rubyid_stub'>stub</span><span class='period'>.</span><span class='id identifier rubyid_stubs'>stubs</span><span class='lparen'>(</span><span class='id identifier rubyid_expectations'>expectations</span><span class='rparen'>)</span>
734  
-  <span class='id identifier rubyid_stub'>stub</span>
735  
-<span class='kw'>end</span></pre>
736  
-    </td>
737  
-  </tr>
738  
-</table>
739  
-</div>
740  
-    
741  
-      <div class="method_details ">
742  
-  <p class="signature " id="stub_everything-instance_method">
743  
-  
744  
-    
745  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>stub_everything</strong>(name, &amp;block) </span>
746  
-    
747  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>stub_everything</strong>(stubbed_methods_vs_return_values = {}, &amp;block) </span>
748  
-    
749  
-      <span class="overload">- (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>stub_everything</strong>(name, stubbed_methods_vs_return_values = {}, &amp;block) </span>
750  
-    
751  
-  
752  
-
753  
-  
754  
-</p><div class="docstring">
755  
-  <div class="discussion">
756  
-    
757  
-<p>Builds a mock object that accepts calls to any method. By default it will
758  
-return <tt>nil</tt> for any method call.</p>
759  
-
760  
-
761  
-  </div>
762  
-</div>
763  
-<div class="tags">
764  
-  
765  
-  <div class="examples">
766  
-    <h3>Examples:</h3>
767  
-    
768  
-      <h4><div class='inline'>
769  
-<p>Ignore invocations of irrelevant methods.</p>
770  
-</div></h4>
771  
-      <pre class="example code"><span class='kw'>def</span> <span class='id identifier rubyid_test_motor_stops'>test_motor_stops</span>
772  
-  <span class='id identifier rubyid_motor'>motor</span> <span class='op'>=</span> <span class='id identifier rubyid_stub_everything'>stub_everything</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>motor</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:stop</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='rparen'>)</span>
773  
-  <span class='id identifier rubyid_assert_nil'>assert_nil</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_irrelevant_method_1'>irrelevant_method_1</span> <span class='comment'># =&gt; no error raised
774  
-</span>  <span class='id identifier rubyid_assert_nil'>assert_nil</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_irrelevant_method_2'>irrelevant_method_2</span> <span class='comment'># =&gt; no error raised
775  
-</span>  <span class='id identifier rubyid_assert'>assert</span> <span class='id identifier rubyid_motor'>motor</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span>
776  
-<span class='kw'>end</span></pre>
777  
-    
778  
-  </div>
779  
-<h3>Parameters:</h3>
780  
-<ul class="param">
781  
-  
782  
-    <li>
783  
-      
784  
-        <span class='name'>name</span>
785  
-      
786  
-      
787  
-        <span class='type'>(<tt>String</tt>)</span>
788  
-      
789  
-      
790  
-      
791  
-        &mdash;
792  
-        <div class='inline'>
793  
-<p>identifies mock object in error messages.</p>
794  
-</div>
795  
-      
796  
-    </li>
797  
-  
798  
-    <li>
799  
-      
800  
-        <span class='name'>stubbed_methods_vs_return_values</span>
801  
-      
802  
-      
803  
-        <span class='type'>(<tt>Hash</tt>)</span>
804  
-      
805  
-      
806  
-      
807  
-        &mdash;
808  
-        <div class='inline'>
809  
-<p>stubbed method name symbols as keys and corresponding return values as
810  
-values - these stubbed methods are setup as if <span class='object_link'><a href="Mock.html#stubs-instance_method" title="Mocha::Mock#stubs (method)">Mock#stubs</a></span> were called
811  
-multiple times.</p>
812  
-</div>
813  
-      
814  
-    </li>
815  
-  
816  
-</ul>
817  
-
818  
-<h3>Yields:</h3>
819  
-<ul class="yield">
820  
-  
821  
-    <li>
822  
-      
823  
-      
824  
-        <span class='type'></span>
825  
-      
826  
-      
827  
-      
828  
-        
829  
-        <div class='inline'>
830  
-<p>optional block to be evaluated against the mock object instance, giving an
831  
-alternative way to setup stubbed methods.</p>
832  
-</div>
833  
-      
834  
-    </li>
835  
-  
836  
-</ul>
837  
-<h3>Returns:</h3>
838  
-<ul class="return">
839  
-  
840  
-    <li>
841  
-      
842  
-      
843  
-        <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
844  
-      
845  
-      
846  
-      
847  
-        &mdash;
848  
-        <div class='inline'>
849  
-<p>a new mock object</p>
850  
-</div>
851  
-      
852  
-    </li>
853  
-  
854  
-</ul>
855  
-
856  
-</div><table class="source_code">
857  
-  <tr>
858  
-    <td>
859  
-      <pre class="lines">
860  
-
861  
-
862  
-103
863  
-104
864  
-105
865  
-106
866  
-107
867  
-108
868  
-109
869  
-110</pre>
870  
-    </td>
871  
-    <td>
872  
-      <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 103</span>
873  
-
874  
-<span class='kw'>def</span> <span class='id identifier rubyid_stub_everything'>stub_everything</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
875  
-  <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='kw'>if</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
876  
-  <span class='id identifier rubyid_expectations'>expectations</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
877  
-  <span class='id identifier rubyid_stub'>stub</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>?</span> <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_named_mock'>named_mock</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Mockery</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_unnamed_mock'>unnamed_mock</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
878  
-  <span class='id identifier rubyid_stub'>stub</span><span class='period'>.</span><span class='id identifier rubyid_stub_everything'>stub_everything</span>
879  
-  <span class='id identifier rubyid_stub'>stub</span><span class='period'>.</span><span class='id identifier rubyid_stubs'>stubs</span><span class='lparen'>(</span><span class='id identifier rubyid_expectations'>expectations</span><span class='rparen'>)</span>
880  
-  <span class='id identifier rubyid_stub'>stub</span>
881  
-<span class='kw'>end</span></pre>
882  
-    </td>
883  
-  </tr>
884  
-</table>
885  
-</div>
886  
-    
887  
-  </div>
888  
-
889  
-</div>
890  
-    
891  
-    <div id="footer">
892  
-  Generated on Wed Apr 25 16:51:30 2012 by 
893  
-  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
894  
-  0.7.5 (ruby-1.9.3).
895  
-</div>
896  
-
897  
-  </body>
898  
-</html>
246  doc/Mocha/ClassMethods.html
... ...
@@ -1,246 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3  
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4  
-  <head>
5  
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6  
-<title>
7  
-  Module: Mocha::ClassMethods
8  
-  
9  
-    &mdash; Mocha 0.11.3
10  
-  
11  
-</title>
12  
-
13  
-  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14  
-
15  
-  <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16  
-
17  
-<script type="text/javascript" charset="utf-8">
18  
-  relpath = '..';
19  
-  if (relpath != '') relpath += '/';
20  
-</script>
21  
-
22  
-  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23  
-
24  
-  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25  
-
26  
-
27  
-  </head>
28  
-  <body>
29  
-    <script type="text/javascript" charset="utf-8">
30  
-      if (window.top.frames.main) document.body.className = 'frames';
31  
-    </script>
32  
-    
33  
-    <div id="header">
34  
-      <div id="menu">
35  
-  
36  
-    <a href="../_index.html">Index (C)</a> &raquo; 
37  
-    <span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
38  
-     &raquo; 
39  
-    <span class="title">ClassMethods</span>
40  
-  
41  
-  
42  
-  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43  
-</div>
44  
-
45  
-      <div id="search">
46  
-  
47  
-    <a id="class_list_link" href="#">Class List</a>
48  
-  
49  
-    <a id="method_list_link" href="#">Method List</a>
50  
-  
51  
-    <a id="file_list_link" href="#">File List</a>
52  
-  
53  
-</div>
54  
-      <div class="clear"></div>
55  
-    </div>
56  
-    
57  
-    <iframe id="search_frame"></iframe>
58  
-    
59  
-    <div id="content"><h1>Module: Mocha::ClassMethods
60  
-  
61  
-  
62  
-  
63  
-</h1>
64  
-
65  
-<dl class="box">
66  
-  
67  
-  
68  
-    
69  
-  
70  
-    
71  
-  
72  
-  
73  
-  
74  
-    <dt class="r1 last">Defined in:</dt>
75  
-    <dd class="r1 last">lib/mocha/object.rb</dd>
76  
-  
77  
-</dl>
78  
-<div class="clear"></div>
79  
-
80  
-<h2>Overview</h2><div class="docstring">
81  
-  <div class="discussion">
82  
-    
83  
-<p>Methods added to all classes to allow mocking and stubbing on real (i.e.
84  
-non-mock) objects.</p>
85  
-
86  
-
87  
-  </div>
88  
-</div>
89  
-<div class="tags">
90  
-  
91  
-
92  
-</div>
93  
-
94  
-
95  
-
96  
-
97  
-
98  
-
99  
-  
100  
-    <h2>
101  
-      Instance Method Summary
102  
-      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
103  
-    </h2>
104  
-
105  
-    <ul class="summary">
106  
-      
107  
-        <li class="public ">