mocha 1.8.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +3 -0
  4. data/.rubocop_todo.yml +7 -30
  5. data/.yardopts +1 -0
  6. data/README.md +40 -13
  7. data/RELEASE.md +97 -0
  8. data/Rakefile +10 -7
  9. data/bin/build-matrix +1 -2
  10. data/docs/CNAME +1 -1
  11. data/docs/Mocha.html +132 -5
  12. data/docs/Mocha/API.html +437 -206
  13. data/docs/Mocha/ClassMethods.html +13 -16
  14. data/docs/Mocha/Configuration.html +1126 -227
  15. data/docs/Mocha/Expectation.html +420 -267
  16. data/docs/Mocha/ExpectationError.html +5 -10
  17. data/docs/Mocha/ExpectationErrorFactory.html +9 -18
  18. data/docs/Mocha/Hooks.html +12 -27
  19. data/docs/Mocha/Integration.html +3 -3
  20. data/docs/Mocha/Integration/MiniTest.html +3 -3
  21. data/docs/Mocha/Integration/MiniTest/Adapter.html +5 -6
  22. data/docs/Mocha/Integration/TestUnit.html +3 -3
  23. data/docs/Mocha/Integration/TestUnit/Adapter.html +5 -6
  24. data/docs/Mocha/Mock.html +202 -162
  25. data/docs/Mocha/ObjectMethods.html +121 -68
  26. data/docs/Mocha/ParameterMatchers.html +21 -109
  27. data/docs/Mocha/ParameterMatchers/AllOf.html +4 -5
  28. data/docs/Mocha/ParameterMatchers/AnyOf.html +4 -5
  29. data/docs/Mocha/ParameterMatchers/AnyParameters.html +3 -3
  30. data/docs/Mocha/ParameterMatchers/Anything.html +3 -3
  31. data/docs/Mocha/ParameterMatchers/Base.html +8 -15
  32. data/docs/Mocha/ParameterMatchers/Equals.html +4 -5
  33. data/docs/Mocha/ParameterMatchers/EquivalentUri.html +3 -3
  34. data/docs/Mocha/ParameterMatchers/HasEntries.html +4 -5
  35. data/docs/Mocha/ParameterMatchers/HasEntry.html +4 -5
  36. data/docs/Mocha/ParameterMatchers/HasKey.html +4 -5
  37. data/docs/Mocha/ParameterMatchers/HasValue.html +4 -5
  38. data/docs/Mocha/ParameterMatchers/Includes.html +4 -5
  39. data/docs/Mocha/ParameterMatchers/InstanceOf.html +4 -5
  40. data/docs/Mocha/ParameterMatchers/IsA.html +3 -3
  41. data/docs/Mocha/ParameterMatchers/KindOf.html +4 -5
  42. data/docs/Mocha/ParameterMatchers/Not.html +4 -5
  43. data/docs/Mocha/ParameterMatchers/Optionally.html +3 -3
  44. data/docs/Mocha/ParameterMatchers/RegexpMatches.html +4 -5
  45. data/docs/Mocha/ParameterMatchers/RespondsWith.html +4 -5
  46. data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +4 -5
  47. data/docs/Mocha/Sequence.html +3 -3
  48. data/docs/Mocha/StateMachine.html +13 -25
  49. data/docs/Mocha/StateMachine/State.html +4 -5
  50. data/docs/Mocha/StateMachine/StatePredicate.html +4 -5
  51. data/docs/Mocha/StubbingError.html +3 -3
  52. data/docs/_index.html +4 -22
  53. data/docs/class_list.html +1 -1
  54. data/docs/file.COPYING.html +3 -3
  55. data/docs/file.MIT-LICENSE.html +3 -3
  56. data/docs/file.README.html +46 -16
  57. data/docs/file.RELEASE.html +130 -3
  58. data/docs/frames.html +1 -1
  59. data/docs/index.html +46 -16
  60. data/docs/js/app.js +11 -0
  61. data/docs/method_list.html +117 -37
  62. data/docs/top-level-namespace.html +3 -3
  63. data/gemfiles/Gemfile.minitest.5.11.3 +7 -0
  64. data/init.rb +1 -3
  65. data/lib/mocha.rb +8 -0
  66. data/lib/mocha/any_instance_method.rb +11 -53
  67. data/lib/mocha/api.rb +120 -56
  68. data/lib/mocha/block_matcher.rb +31 -0
  69. data/lib/mocha/cardinality.rb +26 -11
  70. data/lib/mocha/class_methods.rb +17 -15
  71. data/lib/mocha/configuration.rb +351 -67
  72. data/lib/mocha/deprecation.rb +2 -1
  73. data/lib/mocha/detection/test_unit.rb +1 -3
  74. data/lib/mocha/exception_raiser.rb +2 -1
  75. data/lib/mocha/expectation.rb +102 -63
  76. data/lib/mocha/expectation_error.rb +1 -3
  77. data/lib/mocha/expectation_list.rb +6 -6
  78. data/lib/mocha/inspect.rb +28 -26
  79. data/lib/mocha/instance_method.rb +19 -2
  80. data/lib/mocha/integration.rb +1 -3
  81. data/lib/mocha/integration/mini_test.rb +7 -0
  82. data/lib/mocha/integration/test_unit.rb +7 -0
  83. data/lib/mocha/invocation.rb +77 -0
  84. data/lib/mocha/macos_version.rb +5 -0
  85. data/lib/mocha/minitest.rb +6 -1
  86. data/lib/mocha/mock.rb +46 -31
  87. data/lib/mocha/mockery.rb +25 -61
  88. data/lib/mocha/names.rb +1 -1
  89. data/lib/mocha/object_methods.rb +13 -19
  90. data/lib/mocha/parameter_matchers.rb +1 -1
  91. data/lib/mocha/parameter_matchers/all_of.rb +1 -1
  92. data/lib/mocha/parameter_matchers/any_of.rb +1 -1
  93. data/lib/mocha/parameter_matchers/equivalent_uri.rb +0 -9
  94. data/lib/mocha/parameter_matchers/includes.rb +2 -0
  95. data/lib/mocha/parameter_matchers/instance_methods.rb +18 -0
  96. data/lib/mocha/raised_exception.rb +11 -0
  97. data/lib/mocha/return_values.rb +3 -3
  98. data/lib/mocha/setup.rb +5 -0
  99. data/lib/mocha/single_return_value.rb +2 -1
  100. data/lib/mocha/singleton_class.rb +9 -0
  101. data/lib/mocha/stubbed_method.rb +127 -0
  102. data/lib/mocha/test_unit.rb +6 -1
  103. data/lib/mocha/thrower.rb +2 -1
  104. data/lib/mocha/thrown_object.rb +12 -0
  105. data/lib/mocha/version.rb +1 -1
  106. data/lib/mocha/yield_parameters.rb +5 -11
  107. data/mocha.gemspec +1 -3
  108. data/test/acceptance/acceptance_test_helper.rb +7 -0
  109. data/test/acceptance/bug_18914_test.rb +0 -1
  110. data/test/acceptance/bug_21465_test.rb +0 -1
  111. data/test/acceptance/bug_21563_test.rb +0 -1
  112. data/test/acceptance/display_matching_invocations_alongside_expectations_test.rb +69 -0
  113. data/test/acceptance/exception_rescue_test.rb +1 -2
  114. data/test/acceptance/expectations_on_multiple_methods_test.rb +0 -1
  115. data/test/acceptance/expected_invocation_count_test.rb +2 -3
  116. data/test/acceptance/failure_messages_test.rb +16 -1
  117. data/test/acceptance/issue_272_test.rb +1 -2
  118. data/test/acceptance/issue_65_test.rb +0 -1
  119. data/test/acceptance/issue_70_test.rb +0 -1
  120. data/test/acceptance/mocha_example_test.rb +0 -1
  121. data/test/acceptance/mocha_test_result_test.rb +0 -1
  122. data/test/acceptance/mock_built_with_first_argument_type_being_string_test.rb +99 -0
  123. data/test/acceptance/mock_test.rb +47 -6
  124. data/test/acceptance/mocked_methods_dispatch_test.rb +0 -1
  125. data/test/acceptance/multiple_expectations_failure_message_test.rb +0 -1
  126. data/test/acceptance/multiple_yielding_test.rb +56 -0
  127. data/test/acceptance/optional_parameters_test.rb +0 -1
  128. data/test/acceptance/parameter_matcher_test.rb +0 -1
  129. data/test/acceptance/partial_mocks_test.rb +0 -1
  130. data/test/acceptance/prepend_test.rb +0 -1
  131. data/test/acceptance/prevent_use_of_mocha_outside_test_test.rb +0 -1
  132. data/test/acceptance/raise_exception_test.rb +0 -1
  133. data/test/acceptance/return_value_test.rb +0 -1
  134. data/test/acceptance/sequence_test.rb +0 -1
  135. data/test/acceptance/states_test.rb +0 -1
  136. data/test/acceptance/stub_any_instance_method_defined_on_superclass_test.rb +1 -2
  137. data/test/acceptance/stub_any_instance_method_test.rb +20 -1
  138. data/test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb +0 -1
  139. data/test/acceptance/stub_class_method_defined_on_class_test.rb +0 -1
  140. data/test/acceptance/stub_class_method_defined_on_module_test.rb +0 -1
  141. data/test/acceptance/stub_class_method_defined_on_superclass_test.rb +1 -2
  142. data/test/acceptance/stub_everything_test.rb +0 -1
  143. data/test/acceptance/stub_instance_method_defined_on_active_record_association_proxy_test.rb +0 -1
  144. data/test/acceptance/stub_instance_method_defined_on_class_and_aliased_test.rb +0 -1
  145. data/test/acceptance/stub_instance_method_defined_on_class_test.rb +0 -1
  146. data/test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb +0 -1
  147. data/test/acceptance/stub_instance_method_defined_on_module_test.rb +0 -1
  148. data/test/acceptance/stub_instance_method_defined_on_object_class_test.rb +0 -1
  149. data/test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb +0 -1
  150. data/test/acceptance/stub_instance_method_defined_on_superclass_test.rb +0 -1
  151. data/test/acceptance/stub_method_defined_on_module_and_aliased_test.rb +0 -1
  152. data/test/acceptance/stub_module_method_test.rb +0 -1
  153. data/test/acceptance/stub_test.rb +0 -1
  154. data/test/acceptance/stubba_example_test.rb +0 -1
  155. data/test/acceptance/stubba_test_result_test.rb +0 -1
  156. data/test/acceptance/stubbing_error_backtrace_test.rb +4 -5
  157. data/test/acceptance/stubbing_frozen_object_test.rb +0 -1
  158. data/test/acceptance/stubbing_method_accepting_block_parameter_test.rb +0 -1
  159. data/test/acceptance/stubbing_method_unnecessarily_test.rb +5 -5
  160. data/test/acceptance/stubbing_nil_test.rb +5 -5
  161. data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +27 -11
  162. data/test/acceptance/stubbing_non_existent_class_method_test.rb +11 -11
  163. data/test/acceptance/stubbing_non_existent_instance_method_test.rb +11 -11
  164. data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +8 -8
  165. data/test/acceptance/stubbing_non_public_class_method_test.rb +9 -9
  166. data/test/acceptance/stubbing_non_public_instance_method_test.rb +9 -9
  167. data/test/acceptance/stubbing_on_non_mock_object_test.rb +5 -5
  168. data/test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb +0 -1
  169. data/test/acceptance/throw_test.rb +0 -1
  170. data/test/acceptance/unexpected_invocation_test.rb +0 -1
  171. data/test/acceptance/unstubbing_test.rb +0 -1
  172. data/test/acceptance/yielding_test.rb +78 -0
  173. data/test/integration/shared_tests.rb +5 -3
  174. data/test/method_definer.rb +11 -17
  175. data/test/test_runner.rb +2 -0
  176. data/test/unit/any_instance_method_test.rb +60 -35
  177. data/test/unit/cardinality_test.rb +41 -23
  178. data/test/unit/central_test.rb +0 -1
  179. data/test/unit/class_methods_test.rb +1 -1
  180. data/test/unit/configuration_test.rb +12 -12
  181. data/test/unit/exception_raiser_test.rb +10 -5
  182. data/test/unit/expectation_list_test.rb +13 -11
  183. data/test/unit/expectation_test.rb +117 -103
  184. data/test/unit/instance_method_test.rb +282 -0
  185. data/test/unit/mock_test.rb +28 -19
  186. data/test/unit/mockery_test.rb +8 -11
  187. data/test/unit/module_methods_test.rb +2 -3
  188. data/test/unit/object_inspect_test.rb +6 -4
  189. data/test/unit/object_methods_test.rb +3 -2
  190. data/test/unit/parameter_matchers/equivalent_uri_test.rb +0 -9
  191. data/test/unit/parameter_matchers/has_entries_test.rb +1 -1
  192. data/test/unit/parameter_matchers/has_entry_test.rb +1 -1
  193. data/test/unit/parameter_matchers/has_key_test.rb +1 -1
  194. data/test/unit/parameter_matchers/has_value_test.rb +1 -1
  195. data/test/unit/parameter_matchers/includes_test.rb +1 -1
  196. data/test/unit/parameter_matchers/responds_with_test.rb +1 -1
  197. data/test/unit/return_values_test.rb +25 -20
  198. data/test/unit/single_return_value_test.rb +6 -1
  199. data/test/unit/thrower_test.rb +7 -2
  200. data/test/unit/yield_parameters_test.rb +35 -53
  201. metadata +18 -35
  202. data/docs/Mocha/UnexpectedInvocation.html +0 -140
  203. data/lib/mocha/class_method.rb +0 -113
  204. data/lib/mocha/mini_test.rb +0 -5
  205. data/lib/mocha/module_method.rb +0 -6
  206. data/lib/mocha/module_methods.rb +0 -10
  207. data/lib/mocha/multiple_yields.rb +0 -15
  208. data/lib/mocha/no_yields.rb +0 -5
  209. data/lib/mocha/parameter_matchers/object.rb +0 -15
  210. data/lib/mocha/single_yield.rb +0 -13
  211. data/lib/mocha/standalone.rb +0 -4
  212. data/lib/mocha/unexpected_invocation.rb +0 -24
  213. data/lib/mocha_standalone.rb +0 -4
  214. data/test/acceptance/mock_with_initializer_block_test.rb +0 -56
  215. data/test/unit/class_method_test.rb +0 -254
  216. data/test/unit/multiple_yields_test.rb +0 -16
  217. data/test/unit/no_yields_test.rb +0 -16
  218. data/test/unit/single_yield_test.rb +0 -16
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 1.8.0
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -62,12 +62,16 @@
62
62
  <h3>Description</h3>
63
63
 
64
64
  <ul>
65
- <li>A Ruby library for mocking and stubbing.</li>
65
+ <li>A Ruby library for <a href="http://xunitpatterns.com/Mock%20Object.html">mocking</a> and <a href="http://xunitpatterns.com/Test%20Stub.html">stubbing</a> - but deliberately not (yet) <a href="http://xunitpatterns.com/Fake%20Object.html">faking</a> or <a href="http://xunitpatterns.com/Test%20Spy.html">spying</a>.</li>
66
66
  <li>A unified, simple and readable syntax for both full &amp; partial mocking.</li>
67
67
  <li>Built-in support for MiniTest and Test::Unit.</li>
68
68
  <li>Supported by many other test frameworks.</li>
69
69
  </ul>
70
70
 
71
+ <h3>Intended Usage</h3>
72
+
73
+ <p>Mocha is intended to be used in unit tests for the <a href="http://xunitpatterns.com/Mock%20Object.html">Mock Object</a> or <a href="http://xunitpatterns.com/Test%20Stub.html">Test Stub</a> types of <a href="http://xunitpatterns.com/Test%20Double.html">Test Double</a>, not the <a href="http://xunitpatterns.com/Fake%20Object.html">Fake Object</a> or <a href="http://xunitpatterns.com/Test%20Spy.html">Test Spy</a> types. Although it would be possible to extend Mocha to allow the implementation of fakes and spies, we have chosen to keep it focused on mocks and stubs.</p>
74
+
71
75
  <h3>Installation</h3>
72
76
 
73
77
  <h4>Gem</h4>
@@ -147,31 +151,40 @@
147
151
 
148
152
  <p>Note: There is no need to use a require statement to setup Mocha; RSpec does this itself.</p>
149
153
 
150
- <h4>Rails Plugin</h4>
151
-
152
- <p>Install the Rails plugin...</p>
154
+ <h5>MiniTest</h5>
153
155
 
154
- <pre class="code ruby"><code class="ruby">$ rails plugin install git://github.com/freerange/mocha.git
156
+ <pre class="code ruby"><code class="ruby"><span class='comment'># At bottom of test_helper.rb (or at least after `require &#39;rails/test_help&#39;`)
157
+ </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/minitest</span><span class='tstring_end'>&#39;</span></span>
155
158
  </code></pre>
156
159
 
157
- <p>Note: As of version 0.9.8, the Mocha plugin is not automatically setup at plugin load time. Instead it must be manually setup e.g. at the bottom of your <code>test_helper.rb</code>.</p>
160
+ <h5>Cucumber</h5>
158
161
 
159
- <h5>MiniTest</h5>
162
+ <pre class="code ruby"><code class="ruby"><span class='comment'># In e.g. features/support/mocha.rb
163
+ </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/api</span><span class='tstring_end'>&#39;</span></span>
160
164
 
161
- <pre class="code ruby"><code class="ruby"><span class='comment'># At bottom of test_helper.rb (or at least after `require &#39;rails/test_help&#39;`)
162
- </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/minitest</span><span class='tstring_end'>&#39;</span></span>
165
+ <span class='const'>World</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Mocha.html" title="Mocha (module)">Mocha</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mocha/API.html" title="Mocha::API (module)">API</a></span></span><span class='rparen'>)</span>
166
+
167
+ <span class='const'>Around</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_scenario'>scenario</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
168
+ <span class='kw'>begin</span>
169
+ <span class='id identifier rubyid_mocha_setup'>mocha_setup</span>
170
+ <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
171
+ <span class='id identifier rubyid_mocha_verify'>mocha_verify</span>
172
+ <span class='kw'>ensure</span>
173
+ <span class='id identifier rubyid_mocha_teardown'>mocha_teardown</span>
174
+ <span class='kw'>end</span>
175
+ <span class='kw'>end</span>
163
176
  </code></pre>
164
177
 
165
178
  <h4>Known Issues</h4>
166
179
 
167
180
  <ul>
181
+ <li>In Mocha v1.10.0 an undocumented feature of <code>API#mock</code>, <code>API#stub</code> &amp; <code>API#stub_everything</code> was changed. Previously when these methods were passed a single symbol, they returned a mock object that responded to the method identified by the symbol. Now Passing a single symbol is equivalent to passing a single string, i.e. it now defines the &quot;name&quot; of the mock object.</li>
168
182
  <li>In Mocha v1.2.0 there is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to <a href="https://bugs.ruby-lang.org/issues/12832">a bug in Ruby v2.3.1</a>. See #272. This was fixed in Mocha v1.2.1.</li>
169
183
  <li>Since v1.1.0 Mocha has used prepended modules internally for stubbing methods. There is <a href="https://bugs.ruby-lang.org/issues/12876">an obscure Ruby bug</a> in many (but not all) versions of Ruby between v2.0 &amp; v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 &amp; v2.4.0.</li>
170
184
  <li>Stubbing an aliased class method, where the original method is defined in a module that&#39;s used to <code>extend</code> the class doesn&#39;t work in Ruby 1.8.x. See stub_method_defined_on_module_and_aliased_test.rb for an example of this behaviour.</li>
171
185
  <li>0.13.x versions cause a harmless, but annoying, deprecation warning when used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 &amp; 3.0.0-3.0.19.</li>
172
186
  <li>0.11.x versions don&#39;t work with Rails 3.2.13 (<code>TypeError: superclass mismatch for class ExpectationError</code>). See #115.</li>
173
187
  <li>Versions 0.10.2, 0.10.3 &amp; 0.11.0 of the Mocha gem were broken. Please do not use these versions.</li>
174
- <li>Versions 0.9.6 &amp; 0.9.7 of the Mocha Rails plugin were broken. Please do not use these versions.</li>
175
188
  </ul>
176
189
 
177
190
  <h3>Usage</h3>
@@ -310,7 +323,15 @@
310
323
 
311
324
  <h3>Thread safety</h3>
312
325
 
313
- <p>Mocha is currently <em>not</em> thread-safe. There are two main reasons for this: (a) in multi-threaded code Mocha exceptions may be raised in a thread other than the one which is running the test and thus a Mocha exception may not be correctly intercepted by Mocha exception handling code; and (b) partial mocking changes the state of objects in the <code>ObjectSpace</code> which is shared across all threads in the Ruby process and this access to what is effectively global state is not synchronized.</p>
326
+ <p>Mocha currently <em>does not</em> attempt to be thread-safe.</p>
327
+
328
+ <h4>Can I test multi-threaded code with Mocha?</h4>
329
+
330
+ <p>The short answer is no. In multi-threaded code Mocha exceptions may be raised in a thread other than the one which is running the test and thus a Mocha exception may not be correctly intercepted by Mocha exception handling code.</p>
331
+
332
+ <h4>Can I run my tests across multiple threads?</h4>
333
+
334
+ <p>Maybe, but probably not. Partial mocking changes the state of objects in the <code>ObjectSpace</code> which is shared across all threads in the Ruby process and this access to what is effectively global state is not synchronized. So, for example, if two tests are running concurrently and one uses <code>#any_instance</code> to modify a class, both tests will see those changes immediately.</p>
314
335
 
315
336
  <h3>Expectation matching / invocation order</h3>
316
337
 
@@ -333,6 +354,15 @@
333
354
 
334
355
  <p>See the <a href="https://mocha.jamesmead.org/Mocha/Configuration.html">documentation</a> for <code>Mocha::Configuration</code> for further details.</p>
335
356
 
357
+ <h5>MOCHA_OPTIONS</h5>
358
+
359
+ <p><code>MOCHA_OPTIONS</code> is an environment variable whose value can be set to a comma-separated list, so that we can specify multiple options e.g. <code>MOCHA_OPTIONS=debug,use_test_unit_gem</code>.
360
+ Only the following values are currently recognized and have an effect:</p>
361
+
362
+ <ul>
363
+ <li><code>debug</code>: Enables a debug mode which will output backtraces for each deprecation warning. This is useful for finding where in the test suite the deprecated calls are.</li>
364
+ </ul>
365
+
336
366
  <h3>Useful Links</h3>
337
367
 
338
368
  <ul>
@@ -359,13 +389,13 @@
359
389
  <li>Commit &amp; push to GitHub</li>
360
390
  <li><p>Check Travis CI build is passing - <a href="https://travis-ci.org/freerange/mocha">https://travis-ci.org/freerange/mocha</a></p></li>
361
391
  <li><p>Sign in to Google Analytics - <a href="https://analytics.google.com/analytics/web/">https://analytics.google.com/analytics/web/</a></p></li>
362
- <li><p>Find the web property ID for Go Free Range Ltd &gt; Mocha Documentation (UA-45002715-2)</p></li>
392
+ <li><p>Find the web property ID for floehopper (625523) &gt; Mocha Documentation (UA-625523-7)</p></li>
363
393
  <li><p>Generate documentation:</p></li>
364
394
  </ul>
365
395
 
366
396
  <pre class="code bash"><code class="bash">$ MOCHA_GENERATE_DOCS=true bundle install
367
397
 
368
- $ MOCHA_GENERATE_DOCS=true GOOGLE_ANALYTICS_WEB_PROPERTY_ID=UA-45002715-2 rake generate_docs
398
+ $ MOCHA_GENERATE_DOCS=true GOOGLE_ANALYTICS_WEB_PROPERTY_ID=UA-625523-7 rake generate_docs
369
399
  </code></pre>
370
400
 
371
401
  <ul>
@@ -408,9 +438,9 @@ Pushed mocha 1.2.0 to rubygems.org.
408
438
  </div>
409
439
 
410
440
  <div id="footer">
411
- Generated on Tue Jan 15 17:13:05 2019 by
441
+ Generated on Mon Dec 16 18:49:50 2019 by
412
442
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
413
- 0.9.16 (ruby-2.5.3).
443
+ 0.9.20 (ruby-2.6.5).
414
444
  </div>
415
445
 
416
446
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: RELEASE
8
8
 
9
- &mdash; Mocha 1.8.0
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -59,6 +59,133 @@
59
59
 
60
60
  <div id="content"><div id='filecontents'><h1>Release Notes</h1>
61
61
 
62
+ <h2>1.11.0</h2>
63
+
64
+ <h3>External changes</h3>
65
+
66
+ <ul>
67
+ <li>Add <code>Expectation#with_block_given</code> &amp; <code>Expectation#with_no_block_given</code> (#441).
68
+
69
+ <ul>
70
+ <li>Allows non-deprecated solution for #382. Thanks to @yemartin for reporting and to @techbelly &amp; @nitishr for feedback.</li>
71
+ </ul></li>
72
+ <li>Fix issue with non-Array arguments passed to <code>Expectation#multiple_yields</code> (#444).
73
+
74
+ <ul>
75
+ <li>The undocumented behaviour is now properly supported and documented.</li>
76
+ </ul></li>
77
+ </ul>
78
+
79
+ <h3>Internal changes</h3>
80
+
81
+ <ul>
82
+ <li>Move static YARD options from Rake task to <code>.yardopts</code> file - thanks to @nitishr (#429)</li>
83
+ <li>Simplify implementation of yielding functionality - thanks to @nitishr (#439)</li>
84
+ <li>Add missing require statement to <code>acceptance_test_helper.rb</code> (1070fc02)</li>
85
+ <li>Add some baseline acceptance tests for yielding behaviour (c2cac911)</li>
86
+ <li>Display a sponsor button on GitHub repo page (9fc5911b)</li>
87
+ <li>Use new Deprecation.warning behaviour in <code>Invocation#call</code> (932d1166)</li>
88
+ </ul>
89
+
90
+ <h2>1.10.2</h2>
91
+
92
+ <ul>
93
+ <li>Optionally reinstate undocumented behaviour from v1.9. This introduces a new configuration option (<code>reinstate_undocumented_behaviour_from_v1_9</code>) to reinstate a couple of bits of undocumented behaviour from v1.9 which were changed in v1.10 without any prior deprecation warning (#438):
94
+
95
+ <ul>
96
+ <li>The behaviour of <code>API#mock</code>, <code>API#stub</code> and <code>API#stub_everything</code> when called with a symbol as the first argument.</li>
97
+ <li>The behaviour of <code>Expectation#yields</code> and <code>Expectation#multiple_yields</code> when the stubbed method is called without a block.</li>
98
+ </ul></li>
99
+ </ul>
100
+
101
+ <h2>1.10.1</h2>
102
+
103
+ <ul>
104
+ <li>Ensure ObjectMethods &amp; ClassMethods included when API extended (43778756)</li>
105
+ <li>Fix regression in <code>any_instance</code> stubbing of methods on object which has an implementation of <code>#respond_to?</code> that depends on the object&#39;s internal state - thanks to @rafaelfranca for reporting &amp; @nitishr for fixing (#432, #434, 469d4b17)</li>
106
+ </ul>
107
+
108
+ <h2>1.10.0</h2>
109
+
110
+ <ul>
111
+ <li>Improve deprecation warning when requiring &#39;mocha/setup&#39; (388f44d7)</li>
112
+ <li>Add documentation for Cucumber integration (13ab797b)</li>
113
+ <li>Add documentation about an undocumented feature of <code>API#mock</code>, <code>API#stub</code> &amp; <code>API#stub_everything</code> being changed (7ed2e4e7, d30c1717)</li>
114
+ </ul>
115
+
116
+ <h2>1.10.0.beta.1</h2>
117
+
118
+ <ul>
119
+ <li>Hide <code>ClassMethods#method_visibility</code> &amp; <code>#method_exists?</code> methods to avoid clash with Rails (#428)</li>
120
+ </ul>
121
+
122
+ <h2>1.10.0.alpha</h2>
123
+
124
+ <h3>External changes</h3>
125
+
126
+ <ul>
127
+ <li>Remove dependency on metaclass gem (#49, #365)</li>
128
+ <li>Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377)</li>
129
+ <li>More realistic examples in documentation for <code>Expectation#yields</code> and <code>#multiple_yields</code> - thanks to @nitishr (#352, #383)</li>
130
+ <li>Improve documentation for <code>Mock#responds_like</code> &amp; <code>#responds_like_instance_of</code> - thanks to @nitishr (#337, #384)</li>
131
+ <li>Make <code>Expectation#yields</code> &amp; <code>Expectation#multiple_yields</code> fail when the caller of the stubbed method does not provide a block. This is a change to an undocumented aspect of the public API&#39;s behaviour. If this causes your tests to fail, then fix it by removing the unnecessary call to <code>Expectation#yields</code> or <code>Expectation#multiple_yields</code> - thanks to @nitishr (#382)</li>
132
+ <li>Document <code>MOCHA_OPTIONS</code> in README - thanks to @nitishr (#311, #386)</li>
133
+ <li>Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385)</li>
134
+ <li>Deprecation warning if integration using &#39;mocha/test_unit&#39; or &#39;mocha/minitest&#39; fails - thanks to @nitishr (#229, #389, c6032d0b)</li>
135
+ <li>Require at least one specified sequence for <code>Expectation#in_sequence</code> - thanks to @nitishr (#79, #396, 9020248a)</li>
136
+ <li>Make signatures of <code>Mock#unstub</code> &amp; <code>ObjectMethods#unstub</code> consistent - thanks to @nitishr (#397, f04d437)</li>
137
+ <li>Deprecate requiring &#39;mocha/setup&#39; (36adf880)</li>
138
+ <li>Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410)</li>
139
+ <li>Put deprecations into effect (#400, #418):
140
+
141
+ <ul>
142
+ <li>Remove deprecated &#39;mocha_standalone.rb&#39; &amp; &#39;mocha/standalone.rb&#39;</li>
143
+ <li>Fail fast if no test library loaded</li>
144
+ <li>Removed optional block for <code>Mocha::API#mock</code>, <code>#stub</code> &amp; <code>#stub_everything</code></li>
145
+ <li>Remove deprecated <code>ParameterMatchers#has_equivalent_query_string</code> method</li>
146
+ <li>Remove deprecated &#39;mocha/mini_test.rb&#39;</li>
147
+ </ul></li>
148
+ <li>Fix typo in docs for <code>Mocha::Configuration.prevent</code> (266ce71c)</li>
149
+ <li>New-style configuration (see documentation for <code>Mocha::Configuration</code>) (#407, #421)</li>
150
+ <li>Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d)</li>
151
+ <li>Deprecate support for versions of test-unit &amp; minitest which need monkey-patching (a34e1a88)</li>
152
+ <li>Deprecate old-style Rails plugin (#403, 2df77134)</li>
153
+ <li>Documentation fixes &amp; improvements which also fix YARD warnings (472d5416, a2c0d64a)</li>
154
+ </ul>
155
+
156
+ <h3>Internal changes</h3>
157
+
158
+ <ul>
159
+ <li>Pin minitest to v5.11.3 for Ruby v1.8.7 to fix build; minitest no longer supports Ruby v1.8.7 (4a0a580)</li>
160
+ <li>Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f)</li>
161
+ <li>Only run rubocop for MRI Ruby versions &amp; non-integration test builds (8f1c6af)</li>
162
+ <li>Reduce duplication in any instance method class - thanks to @nitishr (#378)</li>
163
+ <li>Simplify <code>AnyInstanceMethod</code>, <code>ClassMethod</code>, <code>InstanceMethod</code>, <code>ModuleMethod</code> class hierarchy - thanks to @nitishr (#381)</li>
164
+ <li>Simplify <code>ClassMethods#method_exists?</code> &amp; <code>ObjectMethods#method_exists?</code> making them consistent - thanks to @nitishr (#270, #362, #370)</li>
165
+ <li>Don&#39;t override definition of <code>singleton_class</code> in <code>ClassMethods</code> - thanks to @nitishr (#391, #392)</li>
166
+ <li>Do not include &#39;method_definer&#39; methods into all objects (#268, #402)</li>
167
+ <li>Distinguish different <code>ObjectMethods</code> modules (#268, #404)</li>
168
+ <li>Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411)</li>
169
+ <li>Consistently use <code>assert_raises</code> - thanks to @nitishr (#405, #412, a66b7bed)</li>
170
+ <li>Update Ruby &amp; JRuby versions in Travis CI config (18cb1a93, eb061c53)</li>
171
+ <li>Rubocop improvements (aa16ea67...6f4db70b, 2a1240e6...e95716ae)</li>
172
+ <li>Fix inconsistency in CardinalityTest (aa10e0a8)</li>
173
+ <li>Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535)</li>
174
+ <li>Remove default argument in <code>Expectation#invoke</code> - thanks to @nitishr (#414, #420)</li>
175
+ </ul>
176
+
177
+ <h2>1.9.0</h2>
178
+
179
+ <ul>
180
+ <li>Add TruffleRuby to Travis CI build matrix - thanks to @deepj (#354)</li>
181
+ <li>Explicitly set Travis CI OS to Ubuntu Trusty 14.04 (ded1fa45)</li>
182
+ <li>Expand explanation of thread-safety concerns - thanks to @techbelly (#357)</li>
183
+ <li>Refactor class method and any instance method - thanks to @chrisroos (#358)</li>
184
+ <li>Rely on default bundler version in Travis CI builds (3352e9c5)</li>
185
+ <li>Fix local build-matrix script (11abe231)</li>
186
+ <li>No need to install latest bundler in build-matrix script (8247a894)</li>
187
+ </ul>
188
+
62
189
  <h2>1.8.0</h2>
63
190
 
64
191
  <ul>
@@ -865,9 +992,9 @@ Hash with wrong number of entries.</li>
865
992
  </div>
866
993
 
867
994
  <div id="footer">
868
- Generated on Tue Jan 15 17:13:05 2019 by
995
+ Generated on Mon Dec 16 18:49:50 2019 by
869
996
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
870
- 0.9.16 (ruby-2.5.3).
997
+ 0.9.20 (ruby-2.6.5).
871
998
  </div>
872
999
 
873
1000
  </div>
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Mocha 1.8.0</title>
5
+ <title>Mocha 1.11.0</title>
6
6
  </head>
7
7
  <script type="text/javascript" charset="utf-8">
8
8
  var match = unescape(window.location.hash).match(/^#!(.+)/);
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 1.8.0
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -62,12 +62,16 @@
62
62
  <h3>Description</h3>
63
63
 
64
64
  <ul>
65
- <li>A Ruby library for mocking and stubbing.</li>
65
+ <li>A Ruby library for <a href="http://xunitpatterns.com/Mock%20Object.html">mocking</a> and <a href="http://xunitpatterns.com/Test%20Stub.html">stubbing</a> - but deliberately not (yet) <a href="http://xunitpatterns.com/Fake%20Object.html">faking</a> or <a href="http://xunitpatterns.com/Test%20Spy.html">spying</a>.</li>
66
66
  <li>A unified, simple and readable syntax for both full &amp; partial mocking.</li>
67
67
  <li>Built-in support for MiniTest and Test::Unit.</li>
68
68
  <li>Supported by many other test frameworks.</li>
69
69
  </ul>
70
70
 
71
+ <h3>Intended Usage</h3>
72
+
73
+ <p>Mocha is intended to be used in unit tests for the <a href="http://xunitpatterns.com/Mock%20Object.html">Mock Object</a> or <a href="http://xunitpatterns.com/Test%20Stub.html">Test Stub</a> types of <a href="http://xunitpatterns.com/Test%20Double.html">Test Double</a>, not the <a href="http://xunitpatterns.com/Fake%20Object.html">Fake Object</a> or <a href="http://xunitpatterns.com/Test%20Spy.html">Test Spy</a> types. Although it would be possible to extend Mocha to allow the implementation of fakes and spies, we have chosen to keep it focused on mocks and stubs.</p>
74
+
71
75
  <h3>Installation</h3>
72
76
 
73
77
  <h4>Gem</h4>
@@ -147,31 +151,40 @@
147
151
 
148
152
  <p>Note: There is no need to use a require statement to setup Mocha; RSpec does this itself.</p>
149
153
 
150
- <h4>Rails Plugin</h4>
151
-
152
- <p>Install the Rails plugin...</p>
154
+ <h5>MiniTest</h5>
153
155
 
154
- <pre class="code ruby"><code class="ruby">$ rails plugin install git://github.com/freerange/mocha.git
156
+ <pre class="code ruby"><code class="ruby"><span class='comment'># At bottom of test_helper.rb (or at least after `require &#39;rails/test_help&#39;`)
157
+ </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/minitest</span><span class='tstring_end'>&#39;</span></span>
155
158
  </code></pre>
156
159
 
157
- <p>Note: As of version 0.9.8, the Mocha plugin is not automatically setup at plugin load time. Instead it must be manually setup e.g. at the bottom of your <code>test_helper.rb</code>.</p>
160
+ <h5>Cucumber</h5>
158
161
 
159
- <h5>MiniTest</h5>
162
+ <pre class="code ruby"><code class="ruby"><span class='comment'># In e.g. features/support/mocha.rb
163
+ </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/api</span><span class='tstring_end'>&#39;</span></span>
160
164
 
161
- <pre class="code ruby"><code class="ruby"><span class='comment'># At bottom of test_helper.rb (or at least after `require &#39;rails/test_help&#39;`)
162
- </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/minitest</span><span class='tstring_end'>&#39;</span></span>
165
+ <span class='const'>World</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Mocha.html" title="Mocha (module)">Mocha</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mocha/API.html" title="Mocha::API (module)">API</a></span></span><span class='rparen'>)</span>
166
+
167
+ <span class='const'>Around</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_scenario'>scenario</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
168
+ <span class='kw'>begin</span>
169
+ <span class='id identifier rubyid_mocha_setup'>mocha_setup</span>
170
+ <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
171
+ <span class='id identifier rubyid_mocha_verify'>mocha_verify</span>
172
+ <span class='kw'>ensure</span>
173
+ <span class='id identifier rubyid_mocha_teardown'>mocha_teardown</span>
174
+ <span class='kw'>end</span>
175
+ <span class='kw'>end</span>
163
176
  </code></pre>
164
177
 
165
178
  <h4>Known Issues</h4>
166
179
 
167
180
  <ul>
181
+ <li>In Mocha v1.10.0 an undocumented feature of <code>API#mock</code>, <code>API#stub</code> &amp; <code>API#stub_everything</code> was changed. Previously when these methods were passed a single symbol, they returned a mock object that responded to the method identified by the symbol. Now Passing a single symbol is equivalent to passing a single string, i.e. it now defines the &quot;name&quot; of the mock object.</li>
168
182
  <li>In Mocha v1.2.0 there is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to <a href="https://bugs.ruby-lang.org/issues/12832">a bug in Ruby v2.3.1</a>. See #272. This was fixed in Mocha v1.2.1.</li>
169
183
  <li>Since v1.1.0 Mocha has used prepended modules internally for stubbing methods. There is <a href="https://bugs.ruby-lang.org/issues/12876">an obscure Ruby bug</a> in many (but not all) versions of Ruby between v2.0 &amp; v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 &amp; v2.4.0.</li>
170
184
  <li>Stubbing an aliased class method, where the original method is defined in a module that&#39;s used to <code>extend</code> the class doesn&#39;t work in Ruby 1.8.x. See stub_method_defined_on_module_and_aliased_test.rb for an example of this behaviour.</li>
171
185
  <li>0.13.x versions cause a harmless, but annoying, deprecation warning when used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 &amp; 3.0.0-3.0.19.</li>
172
186
  <li>0.11.x versions don&#39;t work with Rails 3.2.13 (<code>TypeError: superclass mismatch for class ExpectationError</code>). See #115.</li>
173
187
  <li>Versions 0.10.2, 0.10.3 &amp; 0.11.0 of the Mocha gem were broken. Please do not use these versions.</li>
174
- <li>Versions 0.9.6 &amp; 0.9.7 of the Mocha Rails plugin were broken. Please do not use these versions.</li>
175
188
  </ul>
176
189
 
177
190
  <h3>Usage</h3>
@@ -310,7 +323,15 @@
310
323
 
311
324
  <h3>Thread safety</h3>
312
325
 
313
- <p>Mocha is currently <em>not</em> thread-safe. There are two main reasons for this: (a) in multi-threaded code Mocha exceptions may be raised in a thread other than the one which is running the test and thus a Mocha exception may not be correctly intercepted by Mocha exception handling code; and (b) partial mocking changes the state of objects in the <code>ObjectSpace</code> which is shared across all threads in the Ruby process and this access to what is effectively global state is not synchronized.</p>
326
+ <p>Mocha currently <em>does not</em> attempt to be thread-safe.</p>
327
+
328
+ <h4>Can I test multi-threaded code with Mocha?</h4>
329
+
330
+ <p>The short answer is no. In multi-threaded code Mocha exceptions may be raised in a thread other than the one which is running the test and thus a Mocha exception may not be correctly intercepted by Mocha exception handling code.</p>
331
+
332
+ <h4>Can I run my tests across multiple threads?</h4>
333
+
334
+ <p>Maybe, but probably not. Partial mocking changes the state of objects in the <code>ObjectSpace</code> which is shared across all threads in the Ruby process and this access to what is effectively global state is not synchronized. So, for example, if two tests are running concurrently and one uses <code>#any_instance</code> to modify a class, both tests will see those changes immediately.</p>
314
335
 
315
336
  <h3>Expectation matching / invocation order</h3>
316
337
 
@@ -333,6 +354,15 @@
333
354
 
334
355
  <p>See the <a href="https://mocha.jamesmead.org/Mocha/Configuration.html">documentation</a> for <code>Mocha::Configuration</code> for further details.</p>
335
356
 
357
+ <h5>MOCHA_OPTIONS</h5>
358
+
359
+ <p><code>MOCHA_OPTIONS</code> is an environment variable whose value can be set to a comma-separated list, so that we can specify multiple options e.g. <code>MOCHA_OPTIONS=debug,use_test_unit_gem</code>.
360
+ Only the following values are currently recognized and have an effect:</p>
361
+
362
+ <ul>
363
+ <li><code>debug</code>: Enables a debug mode which will output backtraces for each deprecation warning. This is useful for finding where in the test suite the deprecated calls are.</li>
364
+ </ul>
365
+
336
366
  <h3>Useful Links</h3>
337
367
 
338
368
  <ul>
@@ -359,13 +389,13 @@
359
389
  <li>Commit &amp; push to GitHub</li>
360
390
  <li><p>Check Travis CI build is passing - <a href="https://travis-ci.org/freerange/mocha">https://travis-ci.org/freerange/mocha</a></p></li>
361
391
  <li><p>Sign in to Google Analytics - <a href="https://analytics.google.com/analytics/web/">https://analytics.google.com/analytics/web/</a></p></li>
362
- <li><p>Find the web property ID for Go Free Range Ltd &gt; Mocha Documentation (UA-45002715-2)</p></li>
392
+ <li><p>Find the web property ID for floehopper (625523) &gt; Mocha Documentation (UA-625523-7)</p></li>
363
393
  <li><p>Generate documentation:</p></li>
364
394
  </ul>
365
395
 
366
396
  <pre class="code bash"><code class="bash">$ MOCHA_GENERATE_DOCS=true bundle install
367
397
 
368
- $ MOCHA_GENERATE_DOCS=true GOOGLE_ANALYTICS_WEB_PROPERTY_ID=UA-45002715-2 rake generate_docs
398
+ $ MOCHA_GENERATE_DOCS=true GOOGLE_ANALYTICS_WEB_PROPERTY_ID=UA-625523-7 rake generate_docs
369
399
  </code></pre>
370
400
 
371
401
  <ul>
@@ -408,9 +438,9 @@ Pushed mocha 1.2.0 to rubygems.org.
408
438
  </div>
409
439
 
410
440
  <div id="footer">
411
- Generated on Tue Jan 15 17:13:05 2019 by
441
+ Generated on Mon Dec 16 18:49:50 2019 by
412
442
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
413
- 0.9.16 (ruby-2.5.3).
443
+ 0.9.20 (ruby-2.6.5).
414
444
  </div>
415
445
 
416
446
  </div>
@@ -275,6 +275,16 @@ function mainFocus() {
275
275
  setTimeout(function() { $('#main').focus(); }, 10);
276
276
  }
277
277
 
278
+ function navigationChange() {
279
+ // This works around the broken anchor navigation with the YARD template.
280
+ window.onpopstate = function() {
281
+ var hash = window.location.hash;
282
+ if (hash !== '' && $(hash)[0]) {
283
+ $(hash)[0].scrollIntoView();
284
+ }
285
+ };
286
+ }
287
+
278
288
  $(document).ready(function() {
279
289
  navResizer();
280
290
  navExpander();
@@ -287,6 +297,7 @@ $(document).ready(function() {
287
297
  constantSummaryToggle();
288
298
  generateTOC();
289
299
  mainFocus();
300
+ navigationChange();
290
301
  });
291
302
 
292
303
  })();