Permalink
Browse files

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

  • Loading branch information...
1 parent 8f1fb1a commit bae7108fad1f437a9674434215afa03e7f509a4e @floehopper floehopper committed May 4, 2012
Showing with 1 addition and 16,418 deletions.
  1. +1 −0 .gitignore
  2. 0 doc/.nojekyll
  3. +0 −112 doc/Mocha.html
  4. +0 −898 doc/Mocha/API.html
  5. +0 −246 doc/Mocha/ClassMethods.html
  6. +0 −471 doc/Mocha/Configuration.html
  7. +0 −2,570 doc/Mocha/Expectation.html
  8. +0 −830 doc/Mocha/Mock.html
  9. +0 −668 doc/Mocha/ObjectMethods.html
  10. +0 −2,715 doc/Mocha/ParameterMatchers.html
  11. +0 −137 doc/Mocha/ParameterMatchers/AllOf.html
  12. +0 −137 doc/Mocha/ParameterMatchers/AnyOf.html
  13. +0 −136 doc/Mocha/ParameterMatchers/AnyParameters.html
  14. +0 −136 doc/Mocha/ParameterMatchers/Anything.html
  15. +0 −419 doc/Mocha/ParameterMatchers/Base.html
  16. +0 −137 doc/Mocha/ParameterMatchers/Equals.html
  17. +0 −137 doc/Mocha/ParameterMatchers/HasEntries.html
  18. +0 −137 doc/Mocha/ParameterMatchers/HasEntry.html
  19. +0 −137 doc/Mocha/ParameterMatchers/HasKey.html
  20. +0 −137 doc/Mocha/ParameterMatchers/HasValue.html
  21. +0 −137 doc/Mocha/ParameterMatchers/Includes.html
  22. +0 −137 doc/Mocha/ParameterMatchers/InstanceOf.html
  23. +0 −136 doc/Mocha/ParameterMatchers/IsA.html
  24. +0 −137 doc/Mocha/ParameterMatchers/KindOf.html
  25. +0 −137 doc/Mocha/ParameterMatchers/Not.html
  26. +0 −136 doc/Mocha/ParameterMatchers/Optionally.html
  27. +0 −136 doc/Mocha/ParameterMatchers/QueryStringMatches.html
  28. +0 −137 doc/Mocha/ParameterMatchers/RegexpMatches.html
  29. +0 −137 doc/Mocha/ParameterMatchers/RespondsWith.html
  30. +0 −137 doc/Mocha/ParameterMatchers/YamlEquivalent.html
  31. +0 −133 doc/Mocha/Sequence.html
  32. +0 −510 doc/Mocha/StateMachine.html
  33. +0 −125 doc/Mocha/StateMachine/State.html
  34. +0 −125 doc/Mocha/StateMachine/StatePredicate.html
  35. +0 −134 doc/Mocha/StubbingError.html
  36. +0 −124 doc/Mocha/UnexpectedInvocation.html
  37. +0 −481 doc/_index.html
  38. +0 −47 doc/class_list.html
  39. +0 −1 doc/css/common.css
  40. +0 −55 doc/css/full_list.css
  41. +0 −322 doc/css/style.css
  42. +0 −72 doc/file.COPYING.html
  43. +0 −86 doc/file.MIT-LICENSE.html
  44. +0 −153 doc/file.README.html
  45. +0 −954 doc/file.RELEASE.html
  46. +0 −108 doc/file.misc.html
  47. +0 −90 doc/file.mocha.html
  48. +0 −129 doc/file.stubba.html
  49. +0 −67 doc/file_list.html
  50. +0 −13 doc/frames.html
  51. +0 −153 doc/index.html
  52. +0 −205 doc/js/app.js
  53. +0 −173 doc/js/full_list.js
  54. +0 −16 doc/js/jquery.js
  55. +0 −510 doc/method_list.html
  56. +0 −105 doc/top-level-namespace.html
View
1 .gitignore
@@ -1,5 +1,6 @@
TODO
Gemfile*.lock
+doc
pkg
templates
agiledox.txt
View
0 doc/.nojekyll
No changes.
View
112 doc/Mocha.html
@@ -1,112 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>
- Module: Mocha
-
- &mdash; Mocha 0.11.3
-
-</title>
-
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
-
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
-
-<script type="text/javascript" charset="utf-8">
- relpath = '';
- if (relpath != '') relpath += '/';
-</script>
-
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
-
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
-
-
- </head>
- <body>
- <script type="text/javascript" charset="utf-8">
- if (window.top.frames.main) document.body.className = 'frames';
- </script>
-
- <div id="header">
- <div id="menu">
-
- <a href="_index.html">Index (M)</a> &raquo;
-
-
- <span class="title">Mocha</span>
-
-
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
-</div>
-
- <div id="search">
-
- <a id="class_list_link" href="#">Class List</a>
-
- <a id="method_list_link" href="#">Method List</a>
-
- <a id="file_list_link" href="#">File List</a>
-
-</div>
- <div class="clear"></div>
- </div>
-
- <iframe id="search_frame"></iframe>
-
- <div id="content"><h1>Module: Mocha
-
-
-
-</h1>
-
-<dl class="box">
-
-
-
-
-
-
-
-
- <dt class="r1 last">Defined in:</dt>
- <dd class="r1 last">lib/mocha/api.rb<span class="defines">,<br />
- 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>
-</dd>
-
-</dl>
-<div class="clear"></div>
-
-<h2>Defined Under Namespace</h2>
-<p class="children">
-
-
- <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>
-
-
-
- <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>
-
-
-</p>
-
-
-
-
-
-
-
-
-
-</div>
-
- <div id="footer">
- Generated on Wed Apr 25 16:51:30 2012 by
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.7.5 (ruby-1.9.3).
-</div>
-
- </body>
-</html>
View
898 doc/Mocha/API.html
@@ -1,898 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>
- Module: Mocha::API
-
- &mdash; Mocha 0.11.3
-
-</title>
-
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
-
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
-
-<script type="text/javascript" charset="utf-8">
- relpath = '..';
- if (relpath != '') relpath += '/';
-</script>
-
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
-
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
-
-
- </head>
- <body>
- <script type="text/javascript" charset="utf-8">
- if (window.top.frames.main) document.body.className = 'frames';
- </script>
-
- <div id="header">
- <div id="menu">
-
- <a href="../_index.html">Index (A)</a> &raquo;
- <span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
- &raquo;
- <span class="title">API</span>
-
-
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
-</div>
-
- <div id="search">
-
- <a id="class_list_link" href="#">Class List</a>
-
- <a id="method_list_link" href="#">Method List</a>
-
- <a id="file_list_link" href="#">File List</a>
-
-</div>
- <div class="clear"></div>
- </div>
-
- <iframe id="search_frame"></iframe>
-
- <div id="content"><h1>Module: Mocha::API
-
-
-
-</h1>
-
-<dl class="box">
-
-
-
-
-
- <dt class="r1">Includes:</dt>
- <dd class="r1"><span class='object_link'><a href="ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span></dd>
-
-
-
-
-
- <dt class="r2 last">Defined in:</dt>
- <dd class="r2 last">lib/mocha/api.rb</dd>
-
-</dl>
-<div class="clear"></div>
-
-<h2>Overview</h2><div class="docstring">
- <div class="discussion">
-
-<p>Methods added to <tt>Test::Unit::TestCase</tt> or equivalent.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
-
-</div>
-
-
-
-
-
-
-
- <h2>
- Instance Method Summary
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
- </h2>
-
- <ul class="summary">
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#mock-instance_method" title="#mock (instance method)">- (Mock) <strong>mock</strong>(*arguments) { ... }</a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Builds a new mock object.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#sequence-instance_method" title="#sequence (instance method)">- (Sequence) <strong>sequence</strong>(name) </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Builds a new sequence which can be used to constrain the order in which
-expectations can occur.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#states-instance_method" title="#states (instance method)">- (StateMachine) <strong>states</strong>(name) </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Builds a new state machine which can be used to constrain the order in
-which expectations can occur.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#stub-instance_method" title="#stub (instance method)">- (Mock) <strong>stub</strong>(*arguments) { ... }</a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Builds a new mock object.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#stub_everything-instance_method" title="#stub_everything (instance method)">- (Mock) <strong>stub_everything</strong>(*arguments) { ... }</a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Builds a mock object that accepts calls to any method.</p>
-</div></span>
-
-</li>
-
-
- </ul>
-
-
-
-
-
-
-
-
-
-
- <h3 class="inherited">Methods included from <span class='object_link'><a href="ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span></h3>
- <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>
-
-
- <div id="instance_method_details" class="method_details_list">
- <h2>Instance Method Details</h2>
-
-
- <div class="method_details first">
- <p class="signature first" id="mock-instance_method">
-
-
- <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>
-
- <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>
-
- <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>
-
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Builds a new mock object</p>
-
-
- </div>
-</div>
-<div class="tags">
-
- <div class="examples">
- <h3>Examples:</h3>
-
- <h4><div class='inline'>
-<p>Using expected_methods_vs_return_values Hash to setup expectations.</p>
-</div></h4>
- <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>
- <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>
- <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='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>
- <span class='comment'># an error will be raised unless both Motor#start and Motor#stop have been called
-</span><span class='kw'>end</span></pre>
-
- <h4><div class='inline'>
-<p>Using the optional block to setup expectations &amp; stubbed methods.</p>
-</div></h4>
- <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>
- <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>
- <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>
- <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>
- <span class='kw'>end</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_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>
- <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>
- <span class='comment'># an error will only be raised if Motor#start(100.rpm) has not been called
-</span><span class='kw'>end</span></pre>
-
- </div>
-<h3>Parameters:</h3>
-<ul class="param">
-
- <li>
-
- <span class='name'>name</span>
-
-
- <span class='type'>(<tt>String</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>identifies mock object in error messages.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>expected_methods_vs_return_values</span>
-
-
- <span class='type'>(<tt>Hash</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>expected method name symbols as keys and corresponding return values as
-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
-multiple times.</p>
-</div>
-
- </li>
-
-</ul>
-
-<h3>Yields:</h3>
-<ul class="yield">
-
- <li>
-
-
- <span class='type'></span>
-
-
-
-
- <div class='inline'>
-<p>optional block to be evaluated against the mock object instance, giving an
-alternative way to setup expectations.</p>
-</div>
-
- </li>
-
-</ul>
-<h3>Returns:</h3>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>a new mock object</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-40
-41
-42
-43
-44
-45
-46</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 40</span>
-
-<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>
- <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>
- <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>
- <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>
- <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>
- <span class='id identifier rubyid_mock'>mock</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <p class="signature " id="sequence-instance_method">
-
- - (<tt><span class='object_link'><a href="Sequence.html" title="Mocha::Sequence (class)">Sequence</a></span></tt>) <strong>sequence</strong>(name)
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Builds a new sequence which can be used to constrain the order in which
-expectations can occur.</p>
-
-<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
-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>
-
-
- </div>
-</div>
-<div class="tags">
-
- <div class="examples">
- <h3>Examples:</h3>
-
- <h4><div class='inline'>
-<p>Ensure methods on egg are invoked in correct order.</p>
-</div></h4>
- <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>
-
-<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>
- <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>
- <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>
- <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>
-<span class='kw'>end</span></pre>
-
- </div>
-
-<h3>Returns:</h3>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="Sequence.html" title="Mocha::Sequence (class)">Sequence</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>a new sequence</p>
-</div>
-
- </li>
-
-</ul>
-
- <h3>See Also:</h3>
- <ul class="see">
-
- <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>
-
- </ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-128
-129
-130</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 128</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <p class="signature " id="states-instance_method">
-
- - (<tt><span class='object_link'><a href="StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>) <strong>states</strong>(name)
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Builds a new state machine which can be used to constrain the order in
-which expectations can occur.</p>
-
-<p>Specify the initial state of the state machine by using
-<span class='object_link'><a href="StateMachine.html#starts_as-instance_method" title="Mocha::StateMachine#starts_as (method)">StateMachine#starts_as</a></span>.</p>
-
-<p>Specify that an expected invocation should change the state of the state
-machine by using <span class='object_link'><a href="Expectation.html#then-instance_method" title="Mocha::Expectation#then (method)">Expectation#then</a></span>.</p>
-
-<p>Specify that an expected invocation should be constrained to occur within a
-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>
-
-<p>A test can contain multiple state machines.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
- <div class="examples">
- <h3>Examples:</h3>
-
- <h4><div class='inline'>
-<p>Constrain expected invocations to occur in particular states.</p>
-</div></h4>
- <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>
-
-<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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
-<span class='kw'>end</span></pre>
-
- </div>
-
-<h3>Returns:</h3>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>a new state machine</p>
-</div>
-
- </li>
-
-</ul>
-
- <h3>See Also:</h3>
- <ul class="see">
-
- <li><span class='object_link'><a href="Expectation.html#then-instance_method" title="Mocha::Expectation#then (method)">Expectation#then</a></span></li>
-
- <li><span class='object_link'><a href="Expectation.html#when-instance_method" title="Mocha::Expectation#when (method)">Expectation#when</a></span></li>
-
- <li><span class='object_link'><a href="StateMachine.html" title="Mocha::StateMachine (class)">StateMachine</a></span></li>
-
- </ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-158
-159
-160</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 158</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <p class="signature " id="stub-instance_method">
-
-
- <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>
-
- <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>
-
- <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>
-
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Builds a new mock object</p>
-
-
- </div>
-</div>
-<div class="tags">
-
- <div class="examples">
- <h3>Examples:</h3>
-
- <h4><div class='inline'>
-<p>Using stubbed_methods_vs_return_values Hash to setup stubbed methods.</p>
-</div></h4>
- <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>
- <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>
- <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='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>
- <span class='comment'># an error will not be raised even if either Motor#start or Motor#stop has not been called
-</span><span class='kw'>end</span></pre>
-
- <h4><div class='inline'>
-<p>Using the optional block to setup expectations &amp; stubbed methods.</p>
-</div></h4>
- <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>
- <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>
- <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>
- <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>
- <span class='kw'>end</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_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>
- <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>
- <span class='comment'># an error will only be raised if Motor#start(100.rpm) has not been called
-</span><span class='kw'>end</span></pre>
-
- </div>
-<h3>Parameters:</h3>
-<ul class="param">
-
- <li>
-
- <span class='name'>name</span>
-
-
- <span class='type'>(<tt>String</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>identifies mock object in error messages.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>stubbed_methods_vs_return_values</span>
-
-
- <span class='type'>(<tt>Hash</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>stubbed method name symbols as keys and corresponding return values as
-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
-multiple times.</p>
-</div>
-
- </li>
-
-</ul>
-
-<h3>Yields:</h3>
-<ul class="yield">
-
- <li>
-
-
- <span class='type'></span>
-
-
-
-
- <div class='inline'>
-<p>optional block to be evaluated against the mock object instance, giving an
-alternative way to setup stubbed methods.</p>
-</div>
-
- </li>
-
-</ul>
-<h3>Returns:</h3>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>a new mock object</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-77
-78
-79
-80
-81
-82
-83</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 77</span>
-
-<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>
- <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>
- <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>
- <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>
- <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>
- <span class='id identifier rubyid_stub'>stub</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <p class="signature " id="stub_everything-instance_method">
-
-
- <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>
-
- <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>
-
- <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>
-
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Builds a mock object that accepts calls to any method. By default it will
-return <tt>nil</tt> for any method call.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
- <div class="examples">
- <h3>Examples:</h3>
-
- <h4><div class='inline'>
-<p>Ignore invocations of irrelevant methods.</p>
-</div></h4>
- <pre class="example code"><span class='kw'>def</span> <span class='id identifier rubyid_test_motor_stops'>test_motor_stops</span>
- <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>
- <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
-</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
-</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>
-<span class='kw'>end</span></pre>
-
- </div>
-<h3>Parameters:</h3>
-<ul class="param">
-
- <li>
-
- <span class='name'>name</span>
-
-
- <span class='type'>(<tt>String</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>identifies mock object in error messages.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>stubbed_methods_vs_return_values</span>
-
-
- <span class='type'>(<tt>Hash</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>stubbed method name symbols as keys and corresponding return values as
-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
-multiple times.</p>
-</div>
-
- </li>
-
-</ul>
-
-<h3>Yields:</h3>
-<ul class="yield">
-
- <li>
-
-
- <span class='type'></span>
-
-
-
-
- <div class='inline'>
-<p>optional block to be evaluated against the mock object instance, giving an
-alternative way to setup stubbed methods.</p>
-</div>
-
- </li>
-
-</ul>
-<h3>Returns:</h3>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>a new mock object</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-103
-104
-105
-106
-107
-108
-109
-110</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/api.rb', line 103</span>
-
-<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>
- <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>
- <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>
- <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>
- <span class='id identifier rubyid_stub'>stub</span><span class='period'>.</span><span class='id identifier rubyid_stub_everything'>stub_everything</span>
- <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>
- <span class='id identifier rubyid_stub'>stub</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- </div>
-
-</div>
-
- <div id="footer">
- Generated on Wed Apr 25 16:51:30 2012 by
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.7.5 (ruby-1.9.3).
-</div>
-
- </body>
-</html>
View
246 doc/Mocha/ClassMethods.html
@@ -1,246 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>
- Module: Mocha::ClassMethods
-
- &mdash; Mocha 0.11.3
-
-</title>
-
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
-
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
-
-<script type="text/javascript" charset="utf-8">
- relpath = '..';
- if (relpath != '') relpath += '/';
-</script>
-
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
-
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
-
-
- </head>
- <body>
- <script type="text/javascript" charset="utf-8">
- if (window.top.frames.main) document.body.className = 'frames';
- </script>
-
- <div id="header">
- <div id="menu">
-
- <a href="../_index.html">Index (C)</a> &raquo;
- <span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
- &raquo;
- <span class="title">ClassMethods</span>
-
-
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
-</div>
-
- <div id="search">
-
- <a id="class_list_link" href="#">Class List</a>
-
- <a id="method_list_link" href="#">Method List</a>
-
- <a id="file_list_link" href="#">File List</a>
-
-</div>
- <div class="clear"></div>
- </div>
-
- <iframe id="search_frame"></iframe>
-
- <div id="content"><h1>Module: Mocha::ClassMethods
-
-
-
-</h1>
-
-<dl class="box">
-
-
-
-
-
-
-
-
- <dt class="r1 last">Defined in:</dt>
- <dd class="r1 last">lib/mocha/object.rb</dd>
-
-</dl>
-<div class="clear"></div>
-
-<h2>Overview</h2><div class="docstring">
- <div class="discussion">
-
-<p>Methods added to all classes to allow mocking and stubbing on real (i.e.
-non-mock) objects.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
-
-</div>
-
-
-
-
-
-
-
- <h2>
- Instance Method Summary
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
- </h2>
-
- <ul class="summary">
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#any_instance-instance_method" title="#any_instance (instance method)">- (Mock) <strong>any_instance</strong> </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>A mock object which will detect calls to any instance of this class.</p>
-</div></span>
-
-</li>
-
-
- </ul>
-
-
-
-
- <div id="instance_method_details" class="method_details_list">
- <h2>Instance Method Details</h2>
-
-
- <div class="method_details first">
- <p class="signature first" id="any_instance-instance_method">
-
- - (<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>) <strong>any_instance</strong>
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>A mock object which will detect calls to any instance of this class.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
- <div class="examples">
- <h3>Examples:</h3>
-
- <h4><div class='inline'>
-<p>Return false to invocation of <tt>Product#save</tt> for any instance of
-<tt>Product</tt>.</p>
-</div></h4>
- <pre class="example code"><span class='const'>Product</span><span class='period'>.</span><span class='id identifier rubyid_any_instance'>any_instance</span><span class='period'>.</span><span class='id identifier rubyid_stubs'>stubs</span><span class='lparen'>(</span><span class='symbol'>:save</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_returns'>returns</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span>
-<span class='id identifier rubyid_product_1'>product_1</span> <span class='op'>=</span> <span class='const'>Product</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
-<span class='id identifier rubyid_assert_equal'>assert_equal</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_product_1'>product_1</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span>
-<span class='id identifier rubyid_product_2'>product_2</span> <span class='op'>=</span> <span class='const'>Product</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
-<span class='id identifier rubyid_assert_equal'>assert_equal</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_product_2'>product_2</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span></pre>
-
- </div>
-
-<h3>Returns:</h3>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="Mock.html" title="Mocha::Mock (class)">Mock</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>a mock object which will detect calls to any instance of this class.</p>
-</div>
-
- </li>
-
-</ul>
-<h3>Raises:</h3>
-<ul class="raise">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="StubbingError.html" title="Mocha::StubbingError (class)">StubbingError</a></span></tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>if attempting to stub method which is not allowed.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-231
-232
-233
-234
-235
-236</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/object.rb', line 231</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_any_instance'>any_instance</span>
- <span class='kw'>if</span> <span class='id identifier rubyid_frozen?'>frozen?</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>StubbingError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>can't stub method on frozen object: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_mocha_inspect'>mocha_inspect</span><span class='rbrace'>}</span><span class='tstring_content'>.any_instance</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_caller'>caller</span><span class='rparen'>)</span>
- <span class='kw'>end</span>
- <span class='ivar'>@any_instance</span> <span class='op'>||=</span> <span class='const'>AnyInstance</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- </div>
-
-</div>
-
- <div id="footer">
- Generated on Wed Apr 25 16:51:30 2012 by
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.7.5 (ruby-1.9.3).
-</div>
-
- </body>
-</html>
View
471 doc/Mocha/Configuration.html
@@ -1,471 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>
- Class: Mocha::Configuration
-
- &mdash; Mocha 0.11.3
-
-</title>
-
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
-
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
-
-<script type="text/javascript" charset="utf-8">
- relpath = '..';
- if (relpath != '') relpath += '/';
-</script>
-
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
-
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
-
-
- </head>
- <body>
- <script type="text/javascript" charset="utf-8">
- if (window.top.frames.main) document.body.className = 'frames';
- </script>
-
- <div id="header">
- <div id="menu">
-
- <a href="../_index.html">Index (C)</a> &raquo;
- <span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
- &raquo;
- <span class="title">Configuration</span>
-
-
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
-</div>
-
- <div id="search">
-
- <a id="class_list_link" href="#">Class List</a>
-
- <a id="method_list_link" href="#">Method List</a>
-
- <a id="file_list_link" href="#">File List</a>
-
-</div>
- <div class="clear"></div>
- </div>
-
- <iframe id="search_frame"></iframe>
-
- <div id="content"><h1>Class: Mocha::Configuration
-
-
-
-</h1>
-
-<dl class="box">
-
- <dt class="r1">Inherits:</dt>
- <dd class="r1">
- <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
-
- <ul class="fullTree">
- <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
-
- <li class="next">Mocha::Configuration</li>
-
- </ul>
- <a href="#" class="inheritanceTree">show all</a>
-
- </dd>
-
-
-
-
-
-
-
-
-
- <dt class="r2 last">Defined in:</dt>
- <dd class="r2 last">lib/mocha/configuration.rb</dd>
-
-</dl>
-<div class="clear"></div>
-
-<h2>Overview</h2><div class="docstring">
- <div class="discussion">
-
-<p>Configuration settings.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
-
-</div>
- <h2>Constant Summary</h2>
-
- <dl class="constants">
-
- <dt id="DEFAULTS-constant" class="">DEFAULTS =
-
- </dt>
- <dd><pre class="code"><span class='lbrace'>{</span>
- <span class='symbol'>:stubbing_method_unnecessarily</span> <span class='op'>=&gt;</span> <span class='symbol'>:allow</span><span class='comma'>,</span>
- <span class='symbol'>:stubbing_method_on_non_mock_object</span> <span class='op'>=&gt;</span> <span class='symbol'>:allow</span><span class='comma'>,</span>
- <span class='symbol'>:stubbing_non_existent_method</span> <span class='op'>=&gt;</span> <span class='symbol'>:allow</span><span class='comma'>,</span>
- <span class='symbol'>:stubbing_non_public_method</span> <span class='op'>=&gt;</span> <span class='symbol'>:allow</span><span class='comma'>,</span>
- <span class='symbol'>:stubbing_method_on_nil</span> <span class='op'>=&gt;</span> <span class='symbol'>:prevent</span><span class='comma'>,</span>
-<span class='rbrace'>}</span></pre></dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
- <h2>
- Class Method Summary
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
- </h2>
-
- <ul class="summary">
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#allow-class_method" title="allow (class method)">+ (Object) <strong>allow</strong>(action) { ... }</a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Allow the specified <tt>action</tt>.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#prevent-class_method" title="prevent (class method)">+ (Object) <strong>prevent</strong>(action) { ... }</a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Raise a <span class='object_link'><a href="StubbingError.html" title="Mocha::StubbingError (class)">StubbingError</a></span> if if the specified <tt>action</tt> is attempted.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#warn_when-class_method" title="warn_when (class method)">+ (Object) <strong>warn_when</strong>(action) { ... }</a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Warn if the specified <tt>action</tt> is attempted.</p>
-</div></span>
-
-</li>
-
-
- </ul>
-
-
-
-
- <div id="class_method_details" class="method_details_list">
- <h2>Class Method Details</h2>
-
-
- <div class="method_details first">
- <p class="signature first" id="allow-class_method">
-
- + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>allow</strong>(action) { ... }
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Allow the specified <tt>action</tt>.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <h3>Parameters:</h3>
-<ul class="param">
-
- <li>
-
- <span class='name'>action</span>
-
-
- <span class='type'>(<tt>Symbol</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>one of <tt>:stubbing_method_unnecessarily</tt>,
-<tt>:stubbing_method_on_non_mock_object</tt>,
-<tt>:stubbing_non_existent_method</tt>,
-<tt>:stubbing_non_public_method</tt>, <tt>:stubbing_method_on_nil</tt>.</p>
-</div>
-
- </li>
-
-</ul>
-
-<h3>Yields:</h3>
-<ul class="yield">
-
- <li>
-
-
- <span class='type'></span>
-
-
-
-
- <div class='inline'>
-<p>optional block during which the configuration change will be changed before
-being returned to its original value at the end of the block.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-20
-21
-22</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/configuration.rb', line 20</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_allow'>allow</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_change_config'>change_config</span> <span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='symbol'>:allow</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <p class="signature " id="prevent-class_method">
-
- + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>prevent</strong>(action) { ... }
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Raise a <span class='object_link'><a href="StubbingError.html" title="Mocha::StubbingError (class)">StubbingError</a></span> if if the specified <tt>action</tt> is attempted.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <h3>Parameters:</h3>
-<ul class="param">
-
- <li>
-
- <span class='name'>action</span>
-
-
- <span class='type'>(<tt>Symbol</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>one of <tt>:stubbing_method_unnecessarily</tt>,
-<tt>:stubbing_method_on_non_mock_object</tt>,
-<tt>:stubbing_non_existent_method</tt>,
-<tt>:stubbing_non_public_method</tt>, <tt>:stubbing_method_on_nil</tt>.</p>
-</div>
-
- </li>
-
-</ul>
-
-<h3>Yields:</h3>
-<ul class="yield">
-
- <li>
-
-
- <span class='type'></span>
-
-
-
-
- <div class='inline'>
-<p>optional block during which the configuration change will be changed before
-being returned to its original value at the end of the block.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-46
-47
-48</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/configuration.rb', line 46</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_prevent'>prevent</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_change_config'>change_config</span> <span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='symbol'>:prevent</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <p class="signature " id="warn_when-class_method">
-
- + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>warn_when</strong>(action) { ... }
-
-
-
-</p><div class="docstring">
- <div class="discussion">
-
-<p>Warn if the specified <tt>action</tt> is attempted.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <h3>Parameters:</h3>
-<ul class="param">
-
- <li>
-
- <span class='name'>action</span>
-
-
- <span class='type'>(<tt>Symbol</tt>)</span>
-
-
-
- &mdash;
- <div class='inline'>
-<p>one of <tt>:stubbing_method_unnecessarily</tt>,
-<tt>:stubbing_method_on_non_mock_object</tt>,
-<tt>:stubbing_non_existent_method</tt>,
-<tt>:stubbing_non_public_method</tt>, <tt>:stubbing_method_on_nil</tt>.</p>
-</div>
-
- </li>
-
-</ul>
-
-<h3>Yields:</h3>
-<ul class="yield">
-
- <li>
-
-
- <span class='type'></span>
-
-
-
-
- <div class='inline'>
-<p>optional block during which the configuration change will be changed before
-being returned to its original value at the end of the block.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-33
-34
-35</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/mocha/configuration.rb', line 33</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_warn_when'>warn_when</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_change_config'>change_config</span> <span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='symbol'>:warn</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- </div>
-
-</div>
-
- <div id="footer">
- Generated on Wed Apr 25 16:51:31 2012 by
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.7.5 (ruby-1.9.3).
-</div>
-
- </body>
-</html>
View
2,570 doc/Mocha/Expectation.html
0 additions, 2,570 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
830 doc/Mocha/Mock.html
@@ -1,830 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>
- Class: Mocha::Mock
-
- &mdash; Mocha 0.11.3
-
-</title>
-
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
-
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
-
-<script type="text/javascript" charset="utf-8">
- relpath = '..';
- if (relpath != '') relpath += '/';
-</script>
-
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
-
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
-
-
- </head>
- <body>
- <script type="text/javascript" charset="utf-8">
- if (window.top.frames.main) document.body.className = 'frames';
- </script>
-
- <div id="header">
- <div id="menu">
-
- <a href="../_index.html">Index (M)</a> &raquo;
- <span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
- &raquo;
- <span class="title">Mock</span>
-
-
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
-</div>
-
- <div id="search">
-
- <a id="class_list_link" href="#">Class List</a>
-
- <a id="method_list_link" href="#">Method List</a>
-
- <a id="file_list_link" href="#">File List</a>
-
-</div>
- <div class="clear"></div>
- </div>
-
- <iframe id="search_frame"></iframe>
-
- <div id="content"><h1>Class: Mocha::Mock
-
-
-
-</h1>
-
-<dl class="box">
-
- <dt class="r1">Inherits:</dt>
- <dd class="r1">
- <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
-
- <ul class="fullTree">
- <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
-
- <li class="next">Mocha::Mock</li>
-
- </ul>
- <a href="#" class="inheritanceTree">show all</a>
-
- </dd>
-
-
-
-
-
-
-
-
-
- <dt class="r2 last">Defined in:</dt>
- <dd class="r2 last">lib/mocha/mock.rb</dd>
-
-</dl>
-<div class="clear"></div>
-
-<h2>Overview</h2><div class="docstring">
- <div class="discussion">
-
-<p>Traditional mock object.</p>
-
-<p>All methods return an <span class='object_link'><a href="Expectation.html" title="Mocha::Expectation (class)">Expectation</a></span> which can be further modified by
-methods on <span class='object_link'><a href="Expectation.html" title="Mocha::Expectation (class)">Expectation</a></span>.</p>