mocha 0.10.5 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING.rdoc +1 -1
- data/README.rdoc +6 -4
- data/RELEASE.rdoc +12 -0
- data/Rakefile +29 -60
- data/doc/Mocha.html +112 -0
- data/doc/Mocha/API.html +898 -0
- data/doc/Mocha/ClassMethods.html +246 -0
- data/doc/Mocha/Configuration.html +471 -0
- data/doc/Mocha/Expectation.html +2570 -0
- data/doc/Mocha/Mock.html +830 -0
- data/doc/Mocha/ObjectMethods.html +668 -0
- data/doc/Mocha/ParameterMatchers.html +2715 -0
- data/doc/Mocha/ParameterMatchers/AllOf.html +137 -0
- data/doc/Mocha/ParameterMatchers/AnyOf.html +137 -0
- data/doc/Mocha/ParameterMatchers/AnyParameters.html +136 -0
- data/doc/Mocha/ParameterMatchers/Anything.html +136 -0
- data/doc/Mocha/ParameterMatchers/Base.html +419 -0
- data/doc/Mocha/ParameterMatchers/Equals.html +137 -0
- data/doc/Mocha/ParameterMatchers/HasEntries.html +137 -0
- data/doc/Mocha/ParameterMatchers/HasEntry.html +137 -0
- data/doc/Mocha/ParameterMatchers/HasKey.html +137 -0
- data/doc/Mocha/ParameterMatchers/HasValue.html +137 -0
- data/doc/Mocha/ParameterMatchers/Includes.html +137 -0
- data/doc/Mocha/ParameterMatchers/InstanceOf.html +137 -0
- data/doc/Mocha/ParameterMatchers/IsA.html +136 -0
- data/doc/Mocha/ParameterMatchers/KindOf.html +137 -0
- data/doc/Mocha/ParameterMatchers/Not.html +137 -0
- data/doc/Mocha/ParameterMatchers/Optionally.html +136 -0
- data/doc/Mocha/ParameterMatchers/QueryStringMatches.html +136 -0
- data/doc/Mocha/ParameterMatchers/RegexpMatches.html +137 -0
- data/doc/Mocha/ParameterMatchers/RespondsWith.html +137 -0
- data/doc/Mocha/ParameterMatchers/YamlEquivalent.html +137 -0
- data/doc/Mocha/Sequence.html +133 -0
- data/doc/Mocha/StateMachine.html +510 -0
- data/doc/Mocha/StateMachine/State.html +125 -0
- data/doc/Mocha/StateMachine/StatePredicate.html +125 -0
- data/doc/Mocha/StubbingError.html +134 -0
- data/doc/Mocha/UnexpectedInvocation.html +124 -0
- data/doc/_index.html +481 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.COPYING.html +72 -0
- data/doc/file.MIT-LICENSE.html +86 -0
- data/doc/file.README.html +153 -0
- data/doc/file.RELEASE.html +933 -0
- data/doc/file.misc.html +108 -0
- data/doc/file.mocha.html +90 -0
- data/doc/file.stubba.html +129 -0
- data/doc/file_list.html +67 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +153 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +510 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/mocha/any_instance_method.rb +16 -11
- data/lib/mocha/api.rb +120 -106
- data/lib/mocha/argument_iterator.rb +6 -6
- data/lib/mocha/backtrace_filter.rb +1 -1
- data/lib/mocha/cardinality.rb +21 -21
- data/lib/mocha/central.rb +8 -8
- data/lib/mocha/change_state_side_effect.rb +5 -5
- data/lib/mocha/class_method.rb +14 -19
- data/lib/mocha/configuration.rb +47 -37
- data/lib/mocha/deprecation.rb +8 -8
- data/lib/mocha/exception_raiser.rb +7 -7
- data/lib/mocha/expectation.rb +173 -77
- data/lib/mocha/expectation_error.rb +2 -2
- data/lib/mocha/expectation_list.rb +11 -11
- data/lib/mocha/in_state_ordering_constraint.rb +5 -5
- data/lib/mocha/inspect.rb +8 -8
- data/lib/mocha/instance_method.rb +1 -17
- data/lib/mocha/integration.rb +9 -9
- data/lib/mocha/integration/mini_test/assertion_counter.rb +9 -9
- data/lib/mocha/integration/mini_test/exception_translation.rb +6 -6
- data/lib/mocha/integration/mini_test/version_13.rb +6 -6
- data/lib/mocha/integration/mini_test/version_140.rb +6 -6
- data/lib/mocha/integration/mini_test/version_141.rb +6 -6
- data/lib/mocha/integration/mini_test/version_142_to_172.rb +7 -7
- data/lib/mocha/integration/mini_test/version_200.rb +7 -7
- data/lib/mocha/integration/test_unit/assertion_counter.rb +10 -10
- data/lib/mocha/integration/test_unit/gem_version_200.rb +6 -6
- data/lib/mocha/integration/test_unit/gem_version_201_to_202.rb +6 -6
- data/lib/mocha/integration/test_unit/ruby_version_185_and_below.rb +6 -6
- data/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb +6 -6
- data/lib/mocha/is_a.rb +1 -1
- data/lib/mocha/logger.rb +6 -6
- data/lib/mocha/method_matcher.rb +7 -7
- data/lib/mocha/mock.rb +85 -48
- data/lib/mocha/mockery.rb +47 -33
- data/lib/mocha/module_method.rb +2 -2
- data/lib/mocha/multiple_yields.rb +9 -9
- data/lib/mocha/names.rb +18 -18
- data/lib/mocha/no_yields.rb +7 -7
- data/lib/mocha/object.rb +104 -75
- data/lib/mocha/parameter_matchers.rb +3 -3
- data/lib/mocha/parameter_matchers/all_of.rb +22 -12
- data/lib/mocha/parameter_matchers/any_of.rb +23 -12
- data/lib/mocha/parameter_matchers/any_parameters.rb +15 -8
- data/lib/mocha/parameter_matchers/anything.rb +20 -11
- data/lib/mocha/parameter_matchers/base.rb +35 -27
- data/lib/mocha/parameter_matchers/equals.rb +23 -12
- data/lib/mocha/parameter_matchers/has_entries.rb +22 -12
- data/lib/mocha/parameter_matchers/has_entry.rb +31 -13
- data/lib/mocha/parameter_matchers/has_key.rb +21 -11
- data/lib/mocha/parameter_matchers/has_value.rb +21 -11
- data/lib/mocha/parameter_matchers/includes.rb +15 -5
- data/lib/mocha/parameter_matchers/instance_of.rb +23 -12
- data/lib/mocha/parameter_matchers/is_a.rb +23 -12
- data/lib/mocha/parameter_matchers/kind_of.rb +23 -12
- data/lib/mocha/parameter_matchers/not.rb +22 -12
- data/lib/mocha/parameter_matchers/object.rb +5 -3
- data/lib/mocha/parameter_matchers/optionally.rb +24 -12
- data/lib/mocha/parameter_matchers/query_string.rb +14 -3
- data/lib/mocha/parameter_matchers/regexp_matches.rb +21 -11
- data/lib/mocha/parameter_matchers/responds_with.rb +17 -6
- data/lib/mocha/parameter_matchers/yaml_equivalent.rb +16 -6
- data/lib/mocha/parameters_matcher.rb +8 -8
- data/lib/mocha/pretty_parameters.rb +7 -7
- data/lib/mocha/return_values.rb +11 -11
- data/lib/mocha/sequence.rb +23 -14
- data/lib/mocha/single_return_value.rb +7 -7
- data/lib/mocha/single_yield.rb +9 -9
- data/lib/mocha/standalone.rb +1 -1
- data/lib/mocha/state_machine.rb +61 -46
- data/lib/mocha/stubbing_error.rb +8 -5
- data/lib/mocha/thrower.rb +2 -2
- data/lib/mocha/unexpected_invocation.rb +9 -6
- data/lib/mocha/version.rb +1 -1
- data/lib/mocha/yield_parameters.rb +10 -10
- data/lib/mocha_standalone.rb +1 -1
- data/mocha.gemspec +4 -7
- data/test/acceptance/acceptance_test_helper.rb +10 -10
- data/test/acceptance/api_test.rb +20 -20
- data/test/acceptance/bug_18914_test.rb +12 -12
- data/test/acceptance/bug_21465_test.rb +6 -6
- data/test/acceptance/bug_21563_test.rb +5 -5
- data/test/acceptance/exception_rescue_test.rb +1 -1
- data/test/acceptance/expected_invocation_count_test.rb +17 -17
- data/test/acceptance/failure_messages_test.rb +13 -13
- data/test/acceptance/minitest_test.rb +39 -39
- data/test/acceptance/mocha_example_test.rb +26 -26
- data/test/acceptance/mocha_test_result_test.rb +13 -13
- data/test/acceptance/mock_test.rb +5 -5
- data/test/acceptance/mock_with_initializer_block_test.rb +5 -5
- data/test/acceptance/mocked_methods_dispatch_test.rb +4 -4
- data/test/acceptance/multiple_expectations_failure_message_test.rb +2 -2
- data/test/acceptance/optional_parameters_test.rb +5 -5
- data/test/acceptance/parameter_matcher_test.rb +18 -18
- data/test/acceptance/partial_mocks_test.rb +9 -9
- data/test/acceptance/raise_exception_test.rb +1 -1
- data/test/acceptance/return_value_test.rb +5 -5
- data/test/acceptance/sequence_test.rb +29 -29
- data/test/acceptance/states_test.rb +17 -17
- data/test/acceptance/stub_any_instance_method_test.rb +13 -13
- data/test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb +7 -7
- data/test/acceptance/stub_everything_test.rb +5 -5
- data/test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb +1 -1
- data/test/acceptance/stub_module_method_test.rb +17 -17
- data/test/acceptance/stub_test.rb +5 -5
- data/test/acceptance/stubba_example_test.rb +24 -24
- data/test/acceptance/stubba_test_result_test.rb +11 -11
- data/test/acceptance/stubbing_error_backtrace_test.rb +6 -6
- data/test/acceptance/stubbing_frozen_object_test.rb +88 -0
- data/test/acceptance/stubbing_method_unnecessarily_test.rb +9 -9
- data/test/acceptance/stubbing_nil_test.rb +59 -0
- data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +13 -13
- data/test/acceptance/stubbing_non_existent_class_method_test.rb +15 -15
- data/test/acceptance/stubbing_non_existent_instance_method_test.rb +14 -14
- data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +13 -13
- data/test/acceptance/stubbing_non_public_class_method_test.rb +12 -12
- data/test/acceptance/stubbing_non_public_instance_method_test.rb +12 -12
- data/test/acceptance/stubbing_on_non_mock_object_test.rb +9 -9
- data/test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb +35 -0
- data/test/acceptance/throw_test.rb +1 -1
- data/test/deprecation_disabler.rb +1 -1
- data/test/execution_point.rb +7 -7
- data/test/method_definer.rb +1 -1
- data/test/mini_test_result.rb +21 -21
- data/test/simple_counter.rb +5 -5
- data/test/test_helper.rb +1 -1
- data/test/test_runner.rb +22 -24
- data/test/test_unit_result.rb +20 -0
- data/test/unit/any_instance_method_test.rb +28 -32
- data/test/unit/array_inspect_test.rb +3 -3
- data/test/unit/backtrace_filter_test.rb +3 -3
- data/test/unit/cardinality_test.rb +12 -12
- data/test/unit/central_test.rb +18 -18
- data/test/unit/change_state_side_effect_test.rb +12 -12
- data/test/unit/class_method_test.rb +33 -91
- data/test/unit/date_time_inspect_test.rb +4 -4
- data/test/unit/exception_raiser_test.rb +5 -5
- data/test/unit/expectation_list_test.rb +7 -7
- data/test/unit/expectation_test.rb +66 -66
- data/test/unit/hash_inspect_test.rb +4 -4
- data/test/unit/in_state_ordering_constraint_test.rb +13 -13
- data/test/unit/method_matcher_test.rb +3 -3
- data/test/unit/mock_test.rb +40 -40
- data/test/unit/mockery_test.rb +25 -25
- data/test/unit/multiple_yields_test.rb +2 -2
- data/test/unit/no_yields_test.rb +2 -2
- data/test/unit/object_inspect_test.rb +4 -4
- data/test/unit/object_test.rb +15 -15
- data/test/unit/parameter_matchers/all_of_test.rb +6 -6
- data/test/unit/parameter_matchers/any_of_test.rb +6 -6
- data/test/unit/parameter_matchers/anything_test.rb +5 -5
- data/test/unit/parameter_matchers/has_entries_test.rb +10 -10
- data/test/unit/parameter_matchers/has_entry_test.rb +13 -13
- data/test/unit/parameter_matchers/has_key_test.rb +11 -11
- data/test/unit/parameter_matchers/has_value_test.rb +12 -12
- data/test/unit/parameter_matchers/includes_test.rb +4 -4
- data/test/unit/parameter_matchers/not_test.rb +6 -6
- data/test/unit/parameter_matchers/regexp_matches_test.rb +9 -9
- data/test/unit/parameter_matchers/responds_with_test.rb +6 -6
- data/test/unit/parameter_matchers/stub_matcher.rb +4 -4
- data/test/unit/parameter_matchers/yaml_equivalent_test.rb +6 -6
- data/test/unit/parameters_matcher_test.rb +16 -16
- data/test/unit/return_values_test.rb +5 -5
- data/test/unit/sequence_test.rb +10 -10
- data/test/unit/single_return_value_test.rb +3 -3
- data/test/unit/single_yield_test.rb +2 -2
- data/test/unit/state_machine_test.rb +19 -19
- data/test/unit/string_inspect_test.rb +2 -2
- data/test/unit/thrower_test.rb +1 -1
- data/test/unit/yield_parameters_test.rb +11 -11
- metadata +113 -101
@@ -0,0 +1,137 @@
|
|
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
|
+
Class: Mocha::ParameterMatchers::RespondsWith
|
8
|
+
|
9
|
+
— Mocha 0.11.0
|
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 (R)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../Mocha.html" title="Mocha (module)">Mocha</a></span></span> » <span class='title'><span class='object_link'><a href="../ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">RespondsWith</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>Class: Mocha::ParameterMatchers::RespondsWith
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Mocha::ParameterMatchers::Base (class)">Base</a></span></span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></li>
|
73
|
+
|
74
|
+
<li class="next"><span class='object_link'><a href="Base.html" title="Mocha::ParameterMatchers::Base (class)">Base</a></span></li>
|
75
|
+
|
76
|
+
<li class="next">Mocha::ParameterMatchers::RespondsWith</li>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
<a href="#" class="inheritanceTree">show all</a>
|
80
|
+
|
81
|
+
</dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<dt class="r2 last">Defined in:</dt>
|
92
|
+
<dd class="r2 last">lib/mocha/parameter_matchers/responds_with.rb</dd>
|
93
|
+
|
94
|
+
</dl>
|
95
|
+
<div class="clear"></div>
|
96
|
+
|
97
|
+
<h2>Overview</h2><div class="docstring">
|
98
|
+
<div class="discussion">
|
99
|
+
|
100
|
+
<p>Parameter matcher which matches if actual parameter returns expected result
|
101
|
+
when specified method is invoked.</p>
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
<div class="tags">
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h2>Method Summary</h2>
|
123
|
+
|
124
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Mocha::ParameterMatchers::Base (class)">Base</a></span></h3>
|
125
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#%26-instance_method" title="Mocha::ParameterMatchers::Base#& (method)">#&</a></span>, <span class='object_link'><a href="Base.html#%7C-instance_method" title="Mocha::ParameterMatchers::Base#| (method)">#|</a></span></p>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="footer">
|
131
|
+
Generated on Thu Apr 19 10:54:34 2012 by
|
132
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
133
|
+
0.7.5 (ruby-1.9.3).
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</body>
|
137
|
+
</html>
|
@@ -0,0 +1,137 @@
|
|
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
|
+
Class: Mocha::ParameterMatchers::YamlEquivalent
|
8
|
+
|
9
|
+
— Mocha 0.11.0
|
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 (Y)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../Mocha.html" title="Mocha (module)">Mocha</a></span></span> » <span class='title'><span class='object_link'><a href="../ParameterMatchers.html" title="Mocha::ParameterMatchers (module)">ParameterMatchers</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">YamlEquivalent</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>Class: Mocha::ParameterMatchers::YamlEquivalent
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Mocha::ParameterMatchers::Base (class)">Base</a></span></span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></li>
|
73
|
+
|
74
|
+
<li class="next"><span class='object_link'><a href="Base.html" title="Mocha::ParameterMatchers::Base (class)">Base</a></span></li>
|
75
|
+
|
76
|
+
<li class="next">Mocha::ParameterMatchers::YamlEquivalent</li>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
<a href="#" class="inheritanceTree">show all</a>
|
80
|
+
|
81
|
+
</dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<dt class="r2 last">Defined in:</dt>
|
92
|
+
<dd class="r2 last">lib/mocha/parameter_matchers/yaml_equivalent.rb</dd>
|
93
|
+
|
94
|
+
</dl>
|
95
|
+
<div class="clear"></div>
|
96
|
+
|
97
|
+
<h2>Overview</h2><div class="docstring">
|
98
|
+
<div class="discussion">
|
99
|
+
|
100
|
+
<p>Parameter matcher which matches if actual parameter is YAML equivalent of
|
101
|
+
specified object.</p>
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
<div class="tags">
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h2>Method Summary</h2>
|
123
|
+
|
124
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Mocha::ParameterMatchers::Base (class)">Base</a></span></h3>
|
125
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#%26-instance_method" title="Mocha::ParameterMatchers::Base#& (method)">#&</a></span>, <span class='object_link'><a href="Base.html#%7C-instance_method" title="Mocha::ParameterMatchers::Base#| (method)">#|</a></span></p>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="footer">
|
131
|
+
Generated on Thu Apr 19 10:54:34 2012 by
|
132
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
133
|
+
0.7.5 (ruby-1.9.3).
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</body>
|
137
|
+
</html>
|
@@ -0,0 +1,133 @@
|
|
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
|
+
Class: Mocha::Sequence
|
8
|
+
|
9
|
+
— Mocha 0.11.0
|
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 (S)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Sequence</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>Class: Mocha::Sequence
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
|
73
|
+
|
74
|
+
<li class="next">Mocha::Sequence</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r2 last">Defined in:</dt>
|
90
|
+
<dd class="r2 last">lib/mocha/sequence.rb</dd>
|
91
|
+
|
92
|
+
</dl>
|
93
|
+
<div class="clear"></div>
|
94
|
+
|
95
|
+
<h2>Overview</h2><div class="docstring">
|
96
|
+
<div class="discussion">
|
97
|
+
|
98
|
+
<p>Used to constrain the order in which expectations can occur.</p>
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
<div class="tags">
|
104
|
+
|
105
|
+
|
106
|
+
<h3>See Also:</h3>
|
107
|
+
<ul class="see">
|
108
|
+
|
109
|
+
<li><span class='object_link'><a href="API.html#sequence-instance_method" title="Mocha::API#sequence (method)">API#sequence</a></span></li>
|
110
|
+
|
111
|
+
<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>
|
112
|
+
|
113
|
+
</ul>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div id="footer">
|
127
|
+
Generated on Thu Apr 19 10:54:34 2012 by
|
128
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
|
+
0.7.5 (ruby-1.9.3).
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</body>
|
133
|
+
</html>
|
@@ -0,0 +1,510 @@
|
|
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
|
+
Class: Mocha::StateMachine
|
8
|
+
|
9
|
+
— Mocha 0.11.0
|
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 (S)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">StateMachine</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>Class: Mocha::StateMachine
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
|
73
|
+
|
74
|
+
<li class="next">Mocha::StateMachine</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r2 last">Defined in:</dt>
|
90
|
+
<dd class="r2 last">lib/mocha/state_machine.rb</dd>
|
91
|
+
|
92
|
+
</dl>
|
93
|
+
<div class="clear"></div>
|
94
|
+
|
95
|
+
<h2>Overview</h2><div class="docstring">
|
96
|
+
<div class="discussion">
|
97
|
+
|
98
|
+
<p>A state machine that is used to constrain the order of invocations. An
|
99
|
+
invocation can be constrained to occur when a state <span class='object_link'><a href="#is-instance_method" title="Mocha::StateMachine#is (method)">#is</a></span>, or <span class='object_link'><a href="#is_not-instance_method" title="Mocha::StateMachine#is_not (method)">#is_not</a></span>,
|
100
|
+
active.</p>
|
101
|
+
|
102
|
+
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
<div class="tags">
|
106
|
+
|
107
|
+
|
108
|
+
</div><h2>Defined Under Namespace</h2>
|
109
|
+
<p class="children">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="StateMachine/State.html" title="Mocha::StateMachine::State (class)">State</a></span>, <span class='object_link'><a href="StateMachine/StatePredicate.html" title="Mocha::StateMachine::StatePredicate (class)">StatePredicate</a></span>
|
115
|
+
|
116
|
+
|
117
|
+
</p>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<h2>
|
127
|
+
Instance Method Summary
|
128
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
129
|
+
</h2>
|
130
|
+
|
131
|
+
<ul class="summary">
|
132
|
+
|
133
|
+
<li class="public ">
|
134
|
+
<span class="summary_signature">
|
135
|
+
|
136
|
+
<a href="#become-instance_method" title="#become (instance method)">- (Object) <strong>become</strong>(next_state_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>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> into the <tt>next_state_name</tt>.</p>
|
151
|
+
</div></span>
|
152
|
+
|
153
|
+
</li>
|
154
|
+
|
155
|
+
|
156
|
+
<li class="public ">
|
157
|
+
<span class="summary_signature">
|
158
|
+
|
159
|
+
<a href="#is-instance_method" title="#is (instance method)">- (State) <strong>is</strong>(state_name) </a>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
</span>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<span class="summary_desc"><div class='inline'>
|
173
|
+
<p>Provides a mechanism to change the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> into the state specified
|
174
|
+
by <tt>state_name</tt> at some point in the future.</p>
|
175
|
+
</div></span>
|
176
|
+
|
177
|
+
</li>
|
178
|
+
|
179
|
+
|
180
|
+
<li class="public ">
|
181
|
+
<span class="summary_signature">
|
182
|
+
|
183
|
+
<a href="#is_not-instance_method" title="#is_not (instance method)">- (Object) <strong>is_not</strong>(state_name) </a>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</span>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<span class="summary_desc"><div class='inline'>
|
197
|
+
<p>Provides a mechanism to determine whether the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> is not in the
|
198
|
+
state specified by <tt>state_name</tt> at some point in the future.</p>
|
199
|
+
</div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="public ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#starts_as-instance_method" title="#starts_as (instance method)">- (StateMachine) <strong>starts_as</strong>(initial_state_name) </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'>
|
221
|
+
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> into the state specified by
|
222
|
+
<tt>initial_state_name</tt>.</p>
|
223
|
+
</div></span>
|
224
|
+
|
225
|
+
</li>
|
226
|
+
|
227
|
+
|
228
|
+
</ul>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<div id="instance_method_details" class="method_details_list">
|
234
|
+
<h2>Instance Method Details</h2>
|
235
|
+
|
236
|
+
|
237
|
+
<div class="method_details first">
|
238
|
+
<p class="signature first" id="become-instance_method">
|
239
|
+
|
240
|
+
- (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>become</strong>(next_state_name)
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
</p><div class="docstring">
|
245
|
+
<div class="discussion">
|
246
|
+
|
247
|
+
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> into the <tt>next_state_name</tt>.</p>
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
<div class="tags">
|
253
|
+
<h3>Parameters:</h3>
|
254
|
+
<ul class="param">
|
255
|
+
|
256
|
+
<li>
|
257
|
+
|
258
|
+
<span class='name'>next_state_name</span>
|
259
|
+
|
260
|
+
|
261
|
+
<span class='type'>(<tt>String</tt>)</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
—
|
266
|
+
<div class='inline'>
|
267
|
+
<p>name of new state</p>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</li>
|
271
|
+
|
272
|
+
</ul>
|
273
|
+
|
274
|
+
|
275
|
+
</div><table class="source_code">
|
276
|
+
<tr>
|
277
|
+
<td>
|
278
|
+
<pre class="lines">
|
279
|
+
|
280
|
+
|
281
|
+
76
|
282
|
+
77
|
283
|
+
78</pre>
|
284
|
+
</td>
|
285
|
+
<td>
|
286
|
+
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 76</span>
|
287
|
+
|
288
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_become'>become</span><span class='lparen'>(</span><span class='id identifier rubyid_next_state_name'>next_state_name</span><span class='rparen'>)</span>
|
289
|
+
<span class='ivar'>@current_state</span> <span class='op'>=</span> <span class='id identifier rubyid_next_state_name'>next_state_name</span>
|
290
|
+
<span class='kw'>end</span></pre>
|
291
|
+
</td>
|
292
|
+
</tr>
|
293
|
+
</table>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
<div class="method_details ">
|
297
|
+
<p class="signature " id="is-instance_method">
|
298
|
+
|
299
|
+
- (<tt><span class='object_link'><a href="StateMachine/State.html" title="Mocha::StateMachine::State (class)">State</a></span></tt>) <strong>is</strong>(state_name)
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
</p><div class="docstring">
|
304
|
+
<div class="discussion">
|
305
|
+
|
306
|
+
<p>Provides a mechanism to change the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> into the state specified
|
307
|
+
by <tt>state_name</tt> at some point in the future.</p>
|
308
|
+
|
309
|
+
<p>Or provides a mechanism to determine whether the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> is in the
|
310
|
+
state specified by <tt>state_name</tt> at some point in the future.</p>
|
311
|
+
|
312
|
+
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
<div class="tags">
|
316
|
+
<h3>Parameters:</h3>
|
317
|
+
<ul class="param">
|
318
|
+
|
319
|
+
<li>
|
320
|
+
|
321
|
+
<span class='name'>state_name</span>
|
322
|
+
|
323
|
+
|
324
|
+
<span class='type'>(<tt>String</tt>)</span>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
—
|
329
|
+
<div class='inline'>
|
330
|
+
<p>name of new state</p>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
</li>
|
334
|
+
|
335
|
+
</ul>
|
336
|
+
|
337
|
+
<h3>Returns:</h3>
|
338
|
+
<ul class="return">
|
339
|
+
|
340
|
+
<li>
|
341
|
+
|
342
|
+
|
343
|
+
<span class='type'>(<tt><span class='object_link'><a href="StateMachine/State.html" title="Mocha::StateMachine::State (class)">State</a></span></tt>)</span>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
—
|
348
|
+
<div class='inline'>
|
349
|
+
<p>state which, when activated, will change the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> into the state
|
350
|
+
with the specified <tt>state_name</tt>.</p>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
</li>
|
354
|
+
|
355
|
+
</ul>
|
356
|
+
|
357
|
+
</div><table class="source_code">
|
358
|
+
<tr>
|
359
|
+
<td>
|
360
|
+
<pre class="lines">
|
361
|
+
|
362
|
+
|
363
|
+
86
|
364
|
+
87
|
365
|
+
88</pre>
|
366
|
+
</td>
|
367
|
+
<td>
|
368
|
+
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 86</span>
|
369
|
+
|
370
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='id identifier rubyid_state_name'>state_name</span><span class='rparen'>)</span>
|
371
|
+
<span class='const'>State</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_state_name'>state_name</span><span class='rparen'>)</span>
|
372
|
+
<span class='kw'>end</span></pre>
|
373
|
+
</td>
|
374
|
+
</tr>
|
375
|
+
</table>
|
376
|
+
</div>
|
377
|
+
|
378
|
+
<div class="method_details ">
|
379
|
+
<p class="signature " id="is_not-instance_method">
|
380
|
+
|
381
|
+
- (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>is_not</strong>(state_name)
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
</p><div class="docstring">
|
386
|
+
<div class="discussion">
|
387
|
+
|
388
|
+
<p>Provides a mechanism to determine whether the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> is not in the
|
389
|
+
state specified by <tt>state_name</tt> at some point in the future.</p>
|
390
|
+
|
391
|
+
|
392
|
+
</div>
|
393
|
+
</div>
|
394
|
+
<div class="tags">
|
395
|
+
|
396
|
+
|
397
|
+
</div><table class="source_code">
|
398
|
+
<tr>
|
399
|
+
<td>
|
400
|
+
<pre class="lines">
|
401
|
+
|
402
|
+
|
403
|
+
91
|
404
|
+
92
|
405
|
+
93</pre>
|
406
|
+
</td>
|
407
|
+
<td>
|
408
|
+
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 91</span>
|
409
|
+
|
410
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_not'>is_not</span><span class='lparen'>(</span><span class='id identifier rubyid_state_name'>state_name</span><span class='rparen'>)</span>
|
411
|
+
<span class='const'>StatePredicate</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_state_name'>state_name</span><span class='rparen'>)</span>
|
412
|
+
<span class='kw'>end</span></pre>
|
413
|
+
</td>
|
414
|
+
</tr>
|
415
|
+
</table>
|
416
|
+
</div>
|
417
|
+
|
418
|
+
<div class="method_details ">
|
419
|
+
<p class="signature " id="starts_as-instance_method">
|
420
|
+
|
421
|
+
- (<tt><span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>) <strong>starts_as</strong>(initial_state_name)
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
</p><div class="docstring">
|
426
|
+
<div class="discussion">
|
427
|
+
|
428
|
+
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> into the state specified by
|
429
|
+
<tt>initial_state_name</tt>.</p>
|
430
|
+
|
431
|
+
|
432
|
+
</div>
|
433
|
+
</div>
|
434
|
+
<div class="tags">
|
435
|
+
<h3>Parameters:</h3>
|
436
|
+
<ul class="param">
|
437
|
+
|
438
|
+
<li>
|
439
|
+
|
440
|
+
<span class='name'>initial_state_name</span>
|
441
|
+
|
442
|
+
|
443
|
+
<span class='type'>(<tt>String</tt>)</span>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
—
|
448
|
+
<div class='inline'>
|
449
|
+
<p>name of initial state</p>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
</li>
|
453
|
+
|
454
|
+
</ul>
|
455
|
+
|
456
|
+
<h3>Returns:</h3>
|
457
|
+
<ul class="return">
|
458
|
+
|
459
|
+
<li>
|
460
|
+
|
461
|
+
|
462
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>)</span>
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
—
|
467
|
+
<div class='inline'>
|
468
|
+
<p>state machine, thereby allowing invocations of other <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> methods
|
469
|
+
to be chained.</p>
|
470
|
+
</div>
|
471
|
+
|
472
|
+
</li>
|
473
|
+
|
474
|
+
</ul>
|
475
|
+
|
476
|
+
</div><table class="source_code">
|
477
|
+
<tr>
|
478
|
+
<td>
|
479
|
+
<pre class="lines">
|
480
|
+
|
481
|
+
|
482
|
+
68
|
483
|
+
69
|
484
|
+
70
|
485
|
+
71</pre>
|
486
|
+
</td>
|
487
|
+
<td>
|
488
|
+
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 68</span>
|
489
|
+
|
490
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_starts_as'>starts_as</span><span class='lparen'>(</span><span class='id identifier rubyid_initial_state_name'>initial_state_name</span><span class='rparen'>)</span>
|
491
|
+
<span class='id identifier rubyid_become'>become</span><span class='lparen'>(</span><span class='id identifier rubyid_initial_state_name'>initial_state_name</span><span class='rparen'>)</span>
|
492
|
+
<span class='kw'>self</span>
|
493
|
+
<span class='kw'>end</span></pre>
|
494
|
+
</td>
|
495
|
+
</tr>
|
496
|
+
</table>
|
497
|
+
</div>
|
498
|
+
|
499
|
+
</div>
|
500
|
+
|
501
|
+
</div>
|
502
|
+
|
503
|
+
<div id="footer">
|
504
|
+
Generated on Thu Apr 19 10:54:34 2012 by
|
505
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
506
|
+
0.7.5 (ruby-1.9.3).
|
507
|
+
</div>
|
508
|
+
|
509
|
+
</body>
|
510
|
+
</html>
|