mocha 1.10.2 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.yardopts +1 -0
- data/CONTRIBUTING.md +1 -1
- data/README.md +28 -30
- data/RELEASE.md +87 -0
- data/Rakefile +7 -5
- data/lib/mocha/api.rb +2 -3
- data/lib/mocha/block_matcher.rb +31 -0
- data/lib/mocha/cardinality.rb +30 -27
- data/lib/mocha/configuration.rb +2 -2
- data/lib/mocha/expectation.rb +71 -30
- data/lib/mocha/inspect.rb +6 -4
- data/lib/mocha/invocation.rb +9 -5
- data/lib/mocha/mock.rb +41 -15
- data/lib/mocha/mockery.rb +17 -27
- data/lib/mocha/parameter_matchers.rb +1 -0
- data/lib/mocha/parameter_matchers/has_entries.rb +2 -3
- data/lib/mocha/parameter_matchers/has_entry.rb +24 -16
- data/lib/mocha/parameter_matchers/has_key.rb +2 -3
- data/lib/mocha/parameter_matchers/has_keys.rb +53 -0
- data/lib/mocha/parameter_matchers/has_value.rb +2 -3
- data/lib/mocha/parameter_matchers/is_a.rb +2 -3
- data/lib/mocha/parameter_matchers/not.rb +2 -3
- data/lib/mocha/state_machine.rb +31 -40
- data/lib/mocha/stubbed_method.rb +4 -6
- data/lib/mocha/version.rb +1 -1
- data/lib/mocha/yield_parameters.rb +5 -11
- data/mocha.gemspec +13 -7
- metadata +8 -210
- data/bin/build-matrix +0 -82
- data/docs/CNAME +0 -1
- data/docs/Mocha.html +0 -254
- data/docs/Mocha/API.html +0 -1287
- data/docs/Mocha/ClassMethods.html +0 -264
- data/docs/Mocha/Configuration.html +0 -1525
- data/docs/Mocha/Expectation.html +0 -2654
- data/docs/Mocha/ExpectationError.html +0 -152
- data/docs/Mocha/ExpectationErrorFactory.html +0 -260
- data/docs/Mocha/Hooks.html +0 -370
- data/docs/Mocha/Integration.html +0 -125
- data/docs/Mocha/Integration/MiniTest.html +0 -123
- data/docs/Mocha/Integration/MiniTest/Adapter.html +0 -164
- data/docs/Mocha/Integration/TestUnit.html +0 -123
- data/docs/Mocha/Integration/TestUnit/Adapter.html +0 -164
- data/docs/Mocha/Mock.html +0 -1237
- data/docs/Mocha/ObjectMethods.html +0 -765
- data/docs/Mocha/ParameterMatchers.html +0 -2961
- data/docs/Mocha/ParameterMatchers/AllOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/AnyOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/AnyParameters.html +0 -153
- data/docs/Mocha/ParameterMatchers/Anything.html +0 -153
- data/docs/Mocha/ParameterMatchers/Base.html +0 -441
- data/docs/Mocha/ParameterMatchers/Equals.html +0 -153
- data/docs/Mocha/ParameterMatchers/EquivalentUri.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasEntries.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasEntry.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasKey.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasValue.html +0 -153
- data/docs/Mocha/ParameterMatchers/Includes.html +0 -153
- data/docs/Mocha/ParameterMatchers/InstanceOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/IsA.html +0 -153
- data/docs/Mocha/ParameterMatchers/KindOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/Not.html +0 -153
- data/docs/Mocha/ParameterMatchers/Optionally.html +0 -153
- data/docs/Mocha/ParameterMatchers/RegexpMatches.html +0 -153
- data/docs/Mocha/ParameterMatchers/RespondsWith.html +0 -153
- data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +0 -153
- data/docs/Mocha/Sequence.html +0 -149
- data/docs/Mocha/StateMachine.html +0 -527
- data/docs/Mocha/StateMachine/State.html +0 -140
- data/docs/Mocha/StateMachine/StatePredicate.html +0 -140
- data/docs/Mocha/StubbingError.html +0 -150
- data/docs/_index.html +0 -519
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -496
- data/docs/file.COPYING.html +0 -81
- data/docs/file.MIT-LICENSE.html +0 -85
- data/docs/file.README.html +0 -448
- data/docs/file.RELEASE.html +0 -974
- data/docs/file_list.html +0 -71
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -448
- data/docs/js/app.js +0 -303
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -635
- data/docs/top-level-namespace.html +0 -118
- data/gemfiles/Gemfile.minitest.1.3.0 +0 -7
- data/gemfiles/Gemfile.minitest.1.4.0 +0 -7
- data/gemfiles/Gemfile.minitest.1.4.1 +0 -7
- data/gemfiles/Gemfile.minitest.1.4.2 +0 -7
- data/gemfiles/Gemfile.minitest.2.0.0 +0 -7
- data/gemfiles/Gemfile.minitest.2.0.1 +0 -7
- data/gemfiles/Gemfile.minitest.2.11.0 +0 -7
- data/gemfiles/Gemfile.minitest.2.11.2 +0 -7
- data/gemfiles/Gemfile.minitest.2.3.0 +0 -7
- data/gemfiles/Gemfile.minitest.5.11.3 +0 -7
- data/gemfiles/Gemfile.test-unit.2.0.0 +0 -7
- data/gemfiles/Gemfile.test-unit.2.0.1 +0 -7
- data/gemfiles/Gemfile.test-unit.2.0.3 +0 -7
- data/lib/mocha/multiple_yields.rb +0 -15
- data/lib/mocha/no_yields.rb +0 -5
- data/lib/mocha/pretty_parameters.rb +0 -24
- data/lib/mocha/single_yield.rb +0 -13
- data/test/acceptance/acceptance_test_helper.rb +0 -41
- data/test/acceptance/bug_18914_test.rb +0 -37
- data/test/acceptance/bug_21465_test.rb +0 -31
- data/test/acceptance/bug_21563_test.rb +0 -22
- data/test/acceptance/display_matching_invocations_alongside_expectations_test.rb +0 -69
- data/test/acceptance/exception_rescue_test.rb +0 -53
- data/test/acceptance/expectations_on_multiple_methods_test.rb +0 -55
- data/test/acceptance/expected_invocation_count_test.rb +0 -229
- data/test/acceptance/failure_messages_test.rb +0 -61
- data/test/acceptance/issue_272_test.rb +0 -50
- data/test/acceptance/issue_65_test.rb +0 -64
- data/test/acceptance/issue_70_test.rb +0 -53
- data/test/acceptance/mocha_example_test.rb +0 -96
- data/test/acceptance/mocha_test_result_test.rb +0 -83
- data/test/acceptance/mock_built_with_first_argument_type_being_string_test.rb +0 -99
- data/test/acceptance/mock_test.rb +0 -139
- data/test/acceptance/mocked_methods_dispatch_test.rb +0 -75
- data/test/acceptance/multiple_expectations_failure_message_test.rb +0 -66
- data/test/acceptance/optional_parameters_test.rb +0 -67
- data/test/acceptance/parameter_matcher_test.rb +0 -299
- data/test/acceptance/partial_mocks_test.rb +0 -44
- data/test/acceptance/prepend_test.rb +0 -86
- data/test/acceptance/prevent_use_of_mocha_outside_test_test.rb +0 -76
- data/test/acceptance/raise_exception_test.rb +0 -36
- data/test/acceptance/return_value_test.rb +0 -49
- data/test/acceptance/sequence_test.rb +0 -189
- data/test/acceptance/states_test.rb +0 -71
- data/test/acceptance/stub_any_instance_method_defined_on_superclass_test.rb +0 -64
- data/test/acceptance/stub_any_instance_method_test.rb +0 -301
- data/test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb +0 -105
- data/test/acceptance/stub_class_method_defined_on_class_test.rb +0 -78
- data/test/acceptance/stub_class_method_defined_on_module_test.rb +0 -73
- data/test/acceptance/stub_class_method_defined_on_superclass_test.rb +0 -144
- data/test/acceptance/stub_everything_test.rb +0 -53
- data/test/acceptance/stub_instance_method_defined_on_active_record_association_proxy_test.rb +0 -91
- data/test/acceptance/stub_instance_method_defined_on_class_and_aliased_test.rb +0 -67
- data/test/acceptance/stub_instance_method_defined_on_class_test.rb +0 -67
- data/test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb +0 -136
- data/test/acceptance/stub_instance_method_defined_on_module_test.rb +0 -76
- data/test/acceptance/stub_instance_method_defined_on_object_class_test.rb +0 -75
- data/test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb +0 -67
- data/test/acceptance/stub_instance_method_defined_on_superclass_test.rb +0 -70
- data/test/acceptance/stub_method_defined_on_module_and_aliased_test.rb +0 -38
- data/test/acceptance/stub_module_method_test.rb +0 -200
- data/test/acceptance/stub_test.rb +0 -49
- data/test/acceptance/stubba_example_test.rb +0 -93
- data/test/acceptance/stubba_test_result_test.rb +0 -71
- data/test/acceptance/stubbing_error_backtrace_test.rb +0 -63
- data/test/acceptance/stubbing_frozen_object_test.rb +0 -88
- data/test/acceptance/stubbing_method_accepting_block_parameter_test.rb +0 -52
- data/test/acceptance/stubbing_method_unnecessarily_test.rb +0 -63
- data/test/acceptance/stubbing_nil_test.rb +0 -60
- data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +0 -157
- data/test/acceptance/stubbing_non_existent_class_method_test.rb +0 -157
- data/test/acceptance/stubbing_non_existent_instance_method_test.rb +0 -145
- data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +0 -128
- data/test/acceptance/stubbing_non_public_class_method_test.rb +0 -163
- data/test/acceptance/stubbing_non_public_instance_method_test.rb +0 -141
- data/test/acceptance/stubbing_on_non_mock_object_test.rb +0 -70
- data/test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb +0 -33
- data/test/acceptance/throw_test.rb +0 -42
- data/test/acceptance/unexpected_invocation_test.rb +0 -23
- data/test/acceptance/unstubbing_test.rb +0 -194
- data/test/assertions.rb +0 -8
- data/test/deprecation_disabler.rb +0 -15
- data/test/execution_point.rb +0 -36
- data/test/integration/mini_test_test.rb +0 -8
- data/test/integration/shared_tests.rb +0 -178
- data/test/integration/test_unit_test.rb +0 -8
- data/test/method_definer.rb +0 -16
- data/test/mini_test_result.rb +0 -96
- data/test/minitest_result.rb +0 -48
- data/test/simple_counter.rb +0 -11
- data/test/test_helper.rb +0 -58
- data/test/test_runner.rb +0 -58
- data/test/test_unit_result.rb +0 -22
- data/test/unit/any_instance_method_test.rb +0 -175
- data/test/unit/array_inspect_test.rb +0 -14
- data/test/unit/backtrace_filter_test.rb +0 -17
- data/test/unit/cardinality_test.rb +0 -72
- data/test/unit/central_test.rb +0 -98
- data/test/unit/change_state_side_effect_test.rb +0 -37
- data/test/unit/class_methods_test.rb +0 -69
- data/test/unit/configuration_test.rb +0 -37
- data/test/unit/date_time_inspect_test.rb +0 -19
- data/test/unit/exception_raiser_test.rb +0 -45
- data/test/unit/expectation_list_test.rb +0 -82
- data/test/unit/expectation_test.rb +0 -492
- data/test/unit/hash_inspect_test.rb +0 -14
- data/test/unit/hooks_test.rb +0 -35
- data/test/unit/in_state_ordering_constraint_test.rb +0 -39
- data/test/unit/instance_method_test.rb +0 -282
- data/test/unit/method_matcher_test.rb +0 -26
- data/test/unit/mock_test.rb +0 -372
- data/test/unit/mockery_test.rb +0 -171
- data/test/unit/module_methods_test.rb +0 -16
- data/test/unit/multiple_yields_test.rb +0 -16
- data/test/unit/no_yields_test.rb +0 -16
- data/test/unit/object_inspect_test.rb +0 -60
- data/test/unit/object_methods_test.rb +0 -63
- data/test/unit/parameter_matchers/all_of_test.rb +0 -24
- data/test/unit/parameter_matchers/any_of_test.rb +0 -24
- data/test/unit/parameter_matchers/anything_test.rb +0 -19
- data/test/unit/parameter_matchers/equals_test.rb +0 -23
- data/test/unit/parameter_matchers/equivalent_uri_test.rb +0 -41
- data/test/unit/parameter_matchers/has_entries_test.rb +0 -51
- data/test/unit/parameter_matchers/has_entry_test.rb +0 -128
- data/test/unit/parameter_matchers/has_key_test.rb +0 -54
- data/test/unit/parameter_matchers/has_value_test.rb +0 -55
- data/test/unit/parameter_matchers/includes_test.rb +0 -106
- data/test/unit/parameter_matchers/instance_of_test.rb +0 -23
- data/test/unit/parameter_matchers/is_a_test.rb +0 -23
- data/test/unit/parameter_matchers/kind_of_test.rb +0 -23
- data/test/unit/parameter_matchers/not_test.rb +0 -24
- data/test/unit/parameter_matchers/regexp_matches_test.rb +0 -45
- data/test/unit/parameter_matchers/responds_with_test.rb +0 -38
- data/test/unit/parameter_matchers/stub_matcher.rb +0 -23
- data/test/unit/parameter_matchers/yaml_equivalent_test.rb +0 -23
- data/test/unit/parameters_matcher_test.rb +0 -119
- data/test/unit/receivers_test.rb +0 -96
- data/test/unit/return_values_test.rb +0 -66
- data/test/unit/sequence_test.rb +0 -100
- data/test/unit/single_return_value_test.rb +0 -17
- data/test/unit/single_yield_test.rb +0 -16
- data/test/unit/state_machine_test.rb +0 -96
- data/test/unit/string_inspect_test.rb +0 -9
- data/test/unit/thrower_test.rb +0 -23
- data/test/unit/yield_parameters_test.rb +0 -91
data/docs/Mocha/Sequence.html
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: Mocha::Sequence
|
8
|
-
|
9
|
-
— Mocha 1.10.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "Mocha::Sequence";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Sequence</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: Mocha::Sequence
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName"><span class='object_link'>Object</span></span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li><span class='object_link'>Object</span></li>
|
76
|
-
|
77
|
-
<li class="next">Mocha::Sequence</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/mocha/sequence.rb</dd>
|
98
|
-
</dl>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
<h2>Overview</h2><div class="docstring">
|
103
|
-
<div class="discussion">
|
104
|
-
|
105
|
-
<p>Used to constrain the order in which expectations can occur.</p>
|
106
|
-
|
107
|
-
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
<div class="tags">
|
111
|
-
|
112
|
-
|
113
|
-
<p class="tag_title">See Also:</p>
|
114
|
-
<ul class="see">
|
115
|
-
|
116
|
-
<li><span class='object_link'><a href="API.html#sequence-instance_method" title="Mocha::API#sequence (method)">API#sequence</a></span></li>
|
117
|
-
|
118
|
-
<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>
|
119
|
-
|
120
|
-
</ul>
|
121
|
-
|
122
|
-
</div>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-625523-7"></script>
|
132
|
-
<script>
|
133
|
-
window.dataLayer = window.dataLayer || [];
|
134
|
-
function gtag(){dataLayer.push(arguments);}
|
135
|
-
gtag('js', new Date());
|
136
|
-
|
137
|
-
gtag('config', 'UA-625523-7');
|
138
|
-
</script>
|
139
|
-
</div>
|
140
|
-
|
141
|
-
<div id="footer">
|
142
|
-
Generated on Thu Dec 12 10:57:48 2019 by
|
143
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
144
|
-
0.9.20 (ruby-2.6.5).
|
145
|
-
</div>
|
146
|
-
|
147
|
-
</div>
|
148
|
-
</body>
|
149
|
-
</html>
|
@@ -1,527 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: Mocha::StateMachine
|
8
|
-
|
9
|
-
— Mocha 1.10.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "Mocha::StateMachine";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../Mocha.html" title="Mocha (module)">Mocha</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">StateMachine</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: Mocha::StateMachine
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName"><span class='object_link'>Object</span></span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li><span class='object_link'>Object</span></li>
|
76
|
-
|
77
|
-
<li class="next">Mocha::StateMachine</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/mocha/state_machine.rb</dd>
|
98
|
-
</dl>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
<h2>Overview</h2><div class="docstring">
|
103
|
-
<div class="discussion">
|
104
|
-
|
105
|
-
<p>A state machine that is used to constrain the order of invocations. An 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>, active.</p>
|
106
|
-
|
107
|
-
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
<div class="tags">
|
111
|
-
|
112
|
-
|
113
|
-
</div><h2>Defined Under Namespace</h2>
|
114
|
-
<p class="children">
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<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>
|
120
|
-
|
121
|
-
|
122
|
-
</p>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<h2>
|
132
|
-
Instance Method Summary
|
133
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
134
|
-
</h2>
|
135
|
-
|
136
|
-
<ul class="summary">
|
137
|
-
|
138
|
-
<li class="public ">
|
139
|
-
<span class="summary_signature">
|
140
|
-
|
141
|
-
<a href="#become-instance_method" title="#become (instance method)">#<strong>become</strong>(next_state_name) ⇒ Object </a>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
</span>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
<span class="summary_desc"><div class='inline'>
|
156
|
-
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> into the <code>next_state_name</code>.</p>
|
157
|
-
</div></span>
|
158
|
-
|
159
|
-
</li>
|
160
|
-
|
161
|
-
|
162
|
-
<li class="public ">
|
163
|
-
<span class="summary_signature">
|
164
|
-
|
165
|
-
<a href="#is-instance_method" title="#is (instance method)">#<strong>is</strong>(state_name) ⇒ State </a>
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
</span>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
<span class="summary_desc"><div class='inline'>
|
180
|
-
<p>Provides a mechanism to change the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> into the state specified by <code>state_name</code> at some point in the future.</p>
|
181
|
-
</div></span>
|
182
|
-
|
183
|
-
</li>
|
184
|
-
|
185
|
-
|
186
|
-
<li class="public ">
|
187
|
-
<span class="summary_signature">
|
188
|
-
|
189
|
-
<a href="#is_not-instance_method" title="#is_not (instance method)">#<strong>is_not</strong>(state_name) ⇒ Object </a>
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
</span>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
<span class="summary_desc"><div class='inline'>
|
204
|
-
<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 state specified by <code>state_name</code> at some point in the future.</p>
|
205
|
-
</div></span>
|
206
|
-
|
207
|
-
</li>
|
208
|
-
|
209
|
-
|
210
|
-
<li class="public ">
|
211
|
-
<span class="summary_signature">
|
212
|
-
|
213
|
-
<a href="#starts_as-instance_method" title="#starts_as (instance method)">#<strong>starts_as</strong>(initial_state_name) ⇒ StateMachine </a>
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
</span>
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
<span class="summary_desc"><div class='inline'>
|
228
|
-
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span> into the state specified by <code>initial_state_name</code>.</p>
|
229
|
-
</div></span>
|
230
|
-
|
231
|
-
</li>
|
232
|
-
|
233
|
-
|
234
|
-
</ul>
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<div id="instance_method_details" class="method_details_list">
|
240
|
-
<h2>Instance Method Details</h2>
|
241
|
-
|
242
|
-
|
243
|
-
<div class="method_details first">
|
244
|
-
<h3 class="signature first" id="become-instance_method">
|
245
|
-
|
246
|
-
#<strong>become</strong>(next_state_name) ⇒ <tt><span class='object_link'>Object</span></tt>
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
</h3><div class="docstring">
|
253
|
-
<div class="discussion">
|
254
|
-
|
255
|
-
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> into the <code>next_state_name</code>.</p>
|
256
|
-
|
257
|
-
|
258
|
-
</div>
|
259
|
-
</div>
|
260
|
-
<div class="tags">
|
261
|
-
<p class="tag_title">Parameters:</p>
|
262
|
-
<ul class="param">
|
263
|
-
|
264
|
-
<li>
|
265
|
-
|
266
|
-
<span class='name'>next_state_name</span>
|
267
|
-
|
268
|
-
|
269
|
-
<span class='type'>(<tt>String</tt>)</span>
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
—
|
274
|
-
<div class='inline'>
|
275
|
-
<p>name of new state</p>
|
276
|
-
</div>
|
277
|
-
|
278
|
-
</li>
|
279
|
-
|
280
|
-
</ul>
|
281
|
-
|
282
|
-
|
283
|
-
</div><table class="source_code">
|
284
|
-
<tr>
|
285
|
-
<td>
|
286
|
-
<pre class="lines">
|
287
|
-
|
288
|
-
|
289
|
-
72
|
290
|
-
73
|
291
|
-
74</pre>
|
292
|
-
</td>
|
293
|
-
<td>
|
294
|
-
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 72</span>
|
295
|
-
|
296
|
-
<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>
|
297
|
-
<span class='ivar'>@current_state</span> <span class='op'>=</span> <span class='id identifier rubyid_next_state_name'>next_state_name</span>
|
298
|
-
<span class='kw'>end</span></pre>
|
299
|
-
</td>
|
300
|
-
</tr>
|
301
|
-
</table>
|
302
|
-
</div>
|
303
|
-
|
304
|
-
<div class="method_details ">
|
305
|
-
<h3 class="signature " id="is-instance_method">
|
306
|
-
|
307
|
-
#<strong>is</strong>(state_name) ⇒ <tt><span class='object_link'><a href="StateMachine/State.html" title="Mocha::StateMachine::State (class)">State</a></span></tt>
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
</h3><div class="docstring">
|
314
|
-
<div class="discussion">
|
315
|
-
|
316
|
-
<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 by <code>state_name</code> at some point in the future.</p>
|
317
|
-
|
318
|
-
<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 state specified by <code>state_name</code> at some point in the future.</p>
|
319
|
-
|
320
|
-
|
321
|
-
</div>
|
322
|
-
</div>
|
323
|
-
<div class="tags">
|
324
|
-
<p class="tag_title">Parameters:</p>
|
325
|
-
<ul class="param">
|
326
|
-
|
327
|
-
<li>
|
328
|
-
|
329
|
-
<span class='name'>state_name</span>
|
330
|
-
|
331
|
-
|
332
|
-
<span class='type'>(<tt>String</tt>)</span>
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
—
|
337
|
-
<div class='inline'>
|
338
|
-
<p>name of new state</p>
|
339
|
-
</div>
|
340
|
-
|
341
|
-
</li>
|
342
|
-
|
343
|
-
</ul>
|
344
|
-
|
345
|
-
<p class="tag_title">Returns:</p>
|
346
|
-
<ul class="return">
|
347
|
-
|
348
|
-
<li>
|
349
|
-
|
350
|
-
|
351
|
-
<span class='type'>(<tt><span class='object_link'><a href="StateMachine/State.html" title="Mocha::StateMachine::State (class)">State</a></span></tt>)</span>
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
—
|
356
|
-
<div class='inline'>
|
357
|
-
<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 with the specified <code>state_name</code>.</p>
|
358
|
-
</div>
|
359
|
-
|
360
|
-
</li>
|
361
|
-
|
362
|
-
</ul>
|
363
|
-
|
364
|
-
</div><table class="source_code">
|
365
|
-
<tr>
|
366
|
-
<td>
|
367
|
-
<pre class="lines">
|
368
|
-
|
369
|
-
|
370
|
-
82
|
371
|
-
83
|
372
|
-
84</pre>
|
373
|
-
</td>
|
374
|
-
<td>
|
375
|
-
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 82</span>
|
376
|
-
|
377
|
-
<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>
|
378
|
-
<span class='const'><span class='object_link'><a href="StateMachine/State.html" title="Mocha::StateMachine::State (class)">State</a></span></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>
|
379
|
-
<span class='kw'>end</span></pre>
|
380
|
-
</td>
|
381
|
-
</tr>
|
382
|
-
</table>
|
383
|
-
</div>
|
384
|
-
|
385
|
-
<div class="method_details ">
|
386
|
-
<h3 class="signature " id="is_not-instance_method">
|
387
|
-
|
388
|
-
#<strong>is_not</strong>(state_name) ⇒ <tt><span class='object_link'>Object</span></tt>
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
</h3><div class="docstring">
|
395
|
-
<div class="discussion">
|
396
|
-
|
397
|
-
<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 state specified by <code>state_name</code> at some point in the future. rubocop:disable Naming/PredicateName</p>
|
398
|
-
|
399
|
-
|
400
|
-
</div>
|
401
|
-
</div>
|
402
|
-
<div class="tags">
|
403
|
-
|
404
|
-
|
405
|
-
</div><table class="source_code">
|
406
|
-
<tr>
|
407
|
-
<td>
|
408
|
-
<pre class="lines">
|
409
|
-
|
410
|
-
|
411
|
-
88
|
412
|
-
89
|
413
|
-
90</pre>
|
414
|
-
</td>
|
415
|
-
<td>
|
416
|
-
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 88</span>
|
417
|
-
|
418
|
-
<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>
|
419
|
-
<span class='const'><span class='object_link'><a href="StateMachine/StatePredicate.html" title="Mocha::StateMachine::StatePredicate (class)">StatePredicate</a></span></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>
|
420
|
-
<span class='kw'>end</span></pre>
|
421
|
-
</td>
|
422
|
-
</tr>
|
423
|
-
</table>
|
424
|
-
</div>
|
425
|
-
|
426
|
-
<div class="method_details ">
|
427
|
-
<h3 class="signature " id="starts_as-instance_method">
|
428
|
-
|
429
|
-
#<strong>starts_as</strong>(initial_state_name) ⇒ <tt><span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
</h3><div class="docstring">
|
436
|
-
<div class="discussion">
|
437
|
-
|
438
|
-
<p>Put the <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> into the state specified by <code>initial_state_name</code>.</p>
|
439
|
-
|
440
|
-
|
441
|
-
</div>
|
442
|
-
</div>
|
443
|
-
<div class="tags">
|
444
|
-
<p class="tag_title">Parameters:</p>
|
445
|
-
<ul class="param">
|
446
|
-
|
447
|
-
<li>
|
448
|
-
|
449
|
-
<span class='name'>initial_state_name</span>
|
450
|
-
|
451
|
-
|
452
|
-
<span class='type'>(<tt>String</tt>)</span>
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
—
|
457
|
-
<div class='inline'>
|
458
|
-
<p>name of initial state</p>
|
459
|
-
</div>
|
460
|
-
|
461
|
-
</li>
|
462
|
-
|
463
|
-
</ul>
|
464
|
-
|
465
|
-
<p class="tag_title">Returns:</p>
|
466
|
-
<ul class="return">
|
467
|
-
|
468
|
-
<li>
|
469
|
-
|
470
|
-
|
471
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Mocha::StateMachine (class)">StateMachine</a></span></tt>)</span>
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
—
|
476
|
-
<div class='inline'>
|
477
|
-
<p>state machine, thereby allowing invocations of other <span class='object_link'><a href="" title="Mocha::StateMachine (class)">Mocha::StateMachine</a></span> methods to be chained.</p>
|
478
|
-
</div>
|
479
|
-
|
480
|
-
</li>
|
481
|
-
|
482
|
-
</ul>
|
483
|
-
|
484
|
-
</div><table class="source_code">
|
485
|
-
<tr>
|
486
|
-
<td>
|
487
|
-
<pre class="lines">
|
488
|
-
|
489
|
-
|
490
|
-
64
|
491
|
-
65
|
492
|
-
66
|
493
|
-
67</pre>
|
494
|
-
</td>
|
495
|
-
<td>
|
496
|
-
<pre class="code"><span class="info file"># File 'lib/mocha/state_machine.rb', line 64</span>
|
497
|
-
|
498
|
-
<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>
|
499
|
-
<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>
|
500
|
-
<span class='kw'>self</span>
|
501
|
-
<span class='kw'>end</span></pre>
|
502
|
-
</td>
|
503
|
-
</tr>
|
504
|
-
</table>
|
505
|
-
</div>
|
506
|
-
|
507
|
-
</div>
|
508
|
-
|
509
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-625523-7"></script>
|
510
|
-
<script>
|
511
|
-
window.dataLayer = window.dataLayer || [];
|
512
|
-
function gtag(){dataLayer.push(arguments);}
|
513
|
-
gtag('js', new Date());
|
514
|
-
|
515
|
-
gtag('config', 'UA-625523-7');
|
516
|
-
</script>
|
517
|
-
</div>
|
518
|
-
|
519
|
-
<div id="footer">
|
520
|
-
Generated on Thu Dec 12 10:57:48 2019 by
|
521
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
522
|
-
0.9.20 (ruby-2.6.5).
|
523
|
-
</div>
|
524
|
-
|
525
|
-
</div>
|
526
|
-
</body>
|
527
|
-
</html>
|