mocha 1.11.2 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -1
  3. data/README.md +28 -30
  4. data/RELEASE.md +25 -0
  5. data/Rakefile +6 -1
  6. data/lib/mocha/cardinality.rb +30 -27
  7. data/lib/mocha/expectation.rb +24 -24
  8. data/lib/mocha/mock.rb +1 -1
  9. data/lib/mocha/mockery.rb +9 -22
  10. data/lib/mocha/state_machine.rb +30 -38
  11. data/lib/mocha/version.rb +1 -1
  12. data/mocha.gemspec +3 -1
  13. metadata +5 -192
  14. data/docs/CNAME +0 -1
  15. data/docs/Mocha.html +0 -254
  16. data/docs/Mocha/API.html +0 -1285
  17. data/docs/Mocha/ClassMethods.html +0 -264
  18. data/docs/Mocha/Configuration.html +0 -1525
  19. data/docs/Mocha/Expectation.html +0 -2862
  20. data/docs/Mocha/ExpectationError.html +0 -152
  21. data/docs/Mocha/ExpectationErrorFactory.html +0 -260
  22. data/docs/Mocha/Hooks.html +0 -370
  23. data/docs/Mocha/Integration.html +0 -125
  24. data/docs/Mocha/Integration/MiniTest.html +0 -123
  25. data/docs/Mocha/Integration/MiniTest/Adapter.html +0 -164
  26. data/docs/Mocha/Integration/TestUnit.html +0 -123
  27. data/docs/Mocha/Integration/TestUnit/Adapter.html +0 -164
  28. data/docs/Mocha/Mock.html +0 -1210
  29. data/docs/Mocha/ObjectMethods.html +0 -765
  30. data/docs/Mocha/ParameterMatchers.html +0 -2949
  31. data/docs/Mocha/ParameterMatchers/AllOf.html +0 -153
  32. data/docs/Mocha/ParameterMatchers/AnyOf.html +0 -153
  33. data/docs/Mocha/ParameterMatchers/AnyParameters.html +0 -153
  34. data/docs/Mocha/ParameterMatchers/Anything.html +0 -153
  35. data/docs/Mocha/ParameterMatchers/Base.html +0 -441
  36. data/docs/Mocha/ParameterMatchers/Equals.html +0 -153
  37. data/docs/Mocha/ParameterMatchers/EquivalentUri.html +0 -153
  38. data/docs/Mocha/ParameterMatchers/HasEntries.html +0 -153
  39. data/docs/Mocha/ParameterMatchers/HasEntry.html +0 -153
  40. data/docs/Mocha/ParameterMatchers/HasKey.html +0 -153
  41. data/docs/Mocha/ParameterMatchers/HasValue.html +0 -153
  42. data/docs/Mocha/ParameterMatchers/Includes.html +0 -153
  43. data/docs/Mocha/ParameterMatchers/InstanceOf.html +0 -153
  44. data/docs/Mocha/ParameterMatchers/IsA.html +0 -153
  45. data/docs/Mocha/ParameterMatchers/KindOf.html +0 -153
  46. data/docs/Mocha/ParameterMatchers/Not.html +0 -153
  47. data/docs/Mocha/ParameterMatchers/Optionally.html +0 -153
  48. data/docs/Mocha/ParameterMatchers/RegexpMatches.html +0 -153
  49. data/docs/Mocha/ParameterMatchers/RespondsWith.html +0 -153
  50. data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +0 -153
  51. data/docs/Mocha/Sequence.html +0 -149
  52. data/docs/Mocha/StateMachine.html +0 -527
  53. data/docs/Mocha/StateMachine/State.html +0 -140
  54. data/docs/Mocha/StateMachine/StatePredicate.html +0 -140
  55. data/docs/Mocha/StubbingError.html +0 -150
  56. data/docs/_index.html +0 -519
  57. data/docs/class_list.html +0 -51
  58. data/docs/css/common.css +0 -1
  59. data/docs/css/full_list.css +0 -58
  60. data/docs/css/style.css +0 -496
  61. data/docs/file.COPYING.html +0 -81
  62. data/docs/file.MIT-LICENSE.html +0 -85
  63. data/docs/file.README.html +0 -448
  64. data/docs/file.RELEASE.html +0 -1028
  65. data/docs/file_list.html +0 -71
  66. data/docs/frames.html +0 -17
  67. data/docs/index.html +0 -448
  68. data/docs/js/app.js +0 -303
  69. data/docs/js/full_list.js +0 -216
  70. data/docs/js/jquery.js +0 -4
  71. data/docs/method_list.html +0 -651
  72. data/docs/top-level-namespace.html +0 -118
  73. data/test/acceptance/acceptance_test_helper.rb +0 -42
  74. data/test/acceptance/bug_18914_test.rb +0 -37
  75. data/test/acceptance/bug_21465_test.rb +0 -31
  76. data/test/acceptance/bug_21563_test.rb +0 -22
  77. data/test/acceptance/display_matching_invocations_alongside_expectations_test.rb +0 -69
  78. data/test/acceptance/exception_rescue_test.rb +0 -53
  79. data/test/acceptance/expectations_on_multiple_methods_test.rb +0 -55
  80. data/test/acceptance/expected_invocation_count_test.rb +0 -229
  81. data/test/acceptance/failure_messages_test.rb +0 -77
  82. data/test/acceptance/issue_272_test.rb +0 -50
  83. data/test/acceptance/issue_457_test.rb +0 -31
  84. data/test/acceptance/issue_65_test.rb +0 -64
  85. data/test/acceptance/issue_70_test.rb +0 -53
  86. data/test/acceptance/mocha_example_test.rb +0 -106
  87. data/test/acceptance/mocha_test_result_test.rb +0 -83
  88. data/test/acceptance/mock_built_with_first_argument_type_being_string_test.rb +0 -98
  89. data/test/acceptance/mock_test.rb +0 -191
  90. data/test/acceptance/mocked_methods_dispatch_test.rb +0 -75
  91. data/test/acceptance/multiple_expectations_failure_message_test.rb +0 -66
  92. data/test/acceptance/multiple_yielding_test.rb +0 -59
  93. data/test/acceptance/optional_parameters_test.rb +0 -67
  94. data/test/acceptance/parameter_matcher_test.rb +0 -299
  95. data/test/acceptance/partial_mocks_test.rb +0 -44
  96. data/test/acceptance/prepend_test.rb +0 -86
  97. data/test/acceptance/prevent_use_of_mocha_outside_test_test.rb +0 -76
  98. data/test/acceptance/raise_exception_test.rb +0 -36
  99. data/test/acceptance/return_value_test.rb +0 -49
  100. data/test/acceptance/sequence_test.rb +0 -189
  101. data/test/acceptance/states_test.rb +0 -71
  102. data/test/acceptance/stub_any_instance_method_defined_on_superclass_test.rb +0 -64
  103. data/test/acceptance/stub_any_instance_method_test.rb +0 -301
  104. data/test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb +0 -105
  105. data/test/acceptance/stub_class_method_defined_on_class_test.rb +0 -78
  106. data/test/acceptance/stub_class_method_defined_on_module_test.rb +0 -73
  107. data/test/acceptance/stub_class_method_defined_on_superclass_test.rb +0 -144
  108. data/test/acceptance/stub_everything_test.rb +0 -53
  109. data/test/acceptance/stub_instance_method_defined_on_active_record_association_proxy_test.rb +0 -91
  110. data/test/acceptance/stub_instance_method_defined_on_class_and_aliased_test.rb +0 -67
  111. data/test/acceptance/stub_instance_method_defined_on_class_test.rb +0 -67
  112. data/test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb +0 -136
  113. data/test/acceptance/stub_instance_method_defined_on_module_test.rb +0 -76
  114. data/test/acceptance/stub_instance_method_defined_on_object_class_test.rb +0 -75
  115. data/test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb +0 -67
  116. data/test/acceptance/stub_instance_method_defined_on_superclass_test.rb +0 -70
  117. data/test/acceptance/stub_method_defined_on_module_and_aliased_test.rb +0 -38
  118. data/test/acceptance/stub_module_method_test.rb +0 -200
  119. data/test/acceptance/stub_test.rb +0 -49
  120. data/test/acceptance/stubba_example_test.rb +0 -103
  121. data/test/acceptance/stubba_test_result_test.rb +0 -71
  122. data/test/acceptance/stubbing_error_backtrace_test.rb +0 -63
  123. data/test/acceptance/stubbing_frozen_object_test.rb +0 -88
  124. data/test/acceptance/stubbing_method_accepting_block_parameter_test.rb +0 -52
  125. data/test/acceptance/stubbing_method_unnecessarily_test.rb +0 -63
  126. data/test/acceptance/stubbing_nil_test.rb +0 -60
  127. data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +0 -157
  128. data/test/acceptance/stubbing_non_existent_class_method_test.rb +0 -157
  129. data/test/acceptance/stubbing_non_existent_instance_method_test.rb +0 -145
  130. data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +0 -128
  131. data/test/acceptance/stubbing_non_public_class_method_test.rb +0 -163
  132. data/test/acceptance/stubbing_non_public_instance_method_test.rb +0 -141
  133. data/test/acceptance/stubbing_on_non_mock_object_test.rb +0 -70
  134. data/test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb +0 -33
  135. data/test/acceptance/throw_test.rb +0 -42
  136. data/test/acceptance/unexpected_invocation_test.rb +0 -23
  137. data/test/acceptance/unstubbing_test.rb +0 -194
  138. data/test/acceptance/yielding_test.rb +0 -80
  139. data/test/assertions.rb +0 -8
  140. data/test/deprecation_disabler.rb +0 -15
  141. data/test/execution_point.rb +0 -36
  142. data/test/integration/mini_test_test.rb +0 -8
  143. data/test/integration/shared_tests.rb +0 -178
  144. data/test/integration/test_unit_test.rb +0 -8
  145. data/test/method_definer.rb +0 -16
  146. data/test/mini_test_result.rb +0 -96
  147. data/test/minitest_result.rb +0 -48
  148. data/test/simple_counter.rb +0 -11
  149. data/test/test_helper.rb +0 -58
  150. data/test/test_runner.rb +0 -58
  151. data/test/test_unit_result.rb +0 -22
  152. data/test/unit/any_instance_method_test.rb +0 -175
  153. data/test/unit/array_inspect_test.rb +0 -14
  154. data/test/unit/backtrace_filter_test.rb +0 -17
  155. data/test/unit/cardinality_test.rb +0 -72
  156. data/test/unit/central_test.rb +0 -98
  157. data/test/unit/change_state_side_effect_test.rb +0 -37
  158. data/test/unit/class_methods_test.rb +0 -69
  159. data/test/unit/configuration_test.rb +0 -37
  160. data/test/unit/date_time_inspect_test.rb +0 -19
  161. data/test/unit/exception_raiser_test.rb +0 -45
  162. data/test/unit/expectation_list_test.rb +0 -82
  163. data/test/unit/expectation_test.rb +0 -504
  164. data/test/unit/hash_inspect_test.rb +0 -14
  165. data/test/unit/hooks_test.rb +0 -35
  166. data/test/unit/in_state_ordering_constraint_test.rb +0 -39
  167. data/test/unit/instance_method_test.rb +0 -282
  168. data/test/unit/method_matcher_test.rb +0 -26
  169. data/test/unit/mock_test.rb +0 -372
  170. data/test/unit/mockery_test.rb +0 -171
  171. data/test/unit/module_methods_test.rb +0 -16
  172. data/test/unit/object_inspect_test.rb +0 -60
  173. data/test/unit/object_methods_test.rb +0 -63
  174. data/test/unit/parameter_matchers/all_of_test.rb +0 -24
  175. data/test/unit/parameter_matchers/any_of_test.rb +0 -24
  176. data/test/unit/parameter_matchers/anything_test.rb +0 -19
  177. data/test/unit/parameter_matchers/equals_test.rb +0 -23
  178. data/test/unit/parameter_matchers/equivalent_uri_test.rb +0 -41
  179. data/test/unit/parameter_matchers/has_entries_test.rb +0 -51
  180. data/test/unit/parameter_matchers/has_entry_test.rb +0 -128
  181. data/test/unit/parameter_matchers/has_key_test.rb +0 -54
  182. data/test/unit/parameter_matchers/has_value_test.rb +0 -55
  183. data/test/unit/parameter_matchers/includes_test.rb +0 -106
  184. data/test/unit/parameter_matchers/instance_of_test.rb +0 -23
  185. data/test/unit/parameter_matchers/is_a_test.rb +0 -23
  186. data/test/unit/parameter_matchers/kind_of_test.rb +0 -23
  187. data/test/unit/parameter_matchers/not_test.rb +0 -24
  188. data/test/unit/parameter_matchers/regexp_matches_test.rb +0 -45
  189. data/test/unit/parameter_matchers/responds_with_test.rb +0 -38
  190. data/test/unit/parameter_matchers/stub_matcher.rb +0 -23
  191. data/test/unit/parameter_matchers/yaml_equivalent_test.rb +0 -23
  192. data/test/unit/parameters_matcher_test.rb +0 -119
  193. data/test/unit/receivers_test.rb +0 -96
  194. data/test/unit/return_values_test.rb +0 -66
  195. data/test/unit/sequence_test.rb +0 -100
  196. data/test/unit/single_return_value_test.rb +0 -17
  197. data/test/unit/state_machine_test.rb +0 -96
  198. data/test/unit/string_inspect_test.rb +0 -9
  199. data/test/unit/thrower_test.rb +0 -23
  200. data/test/unit/yield_parameters_test.rb +0 -73
@@ -1,1028 +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
- File: RELEASE
8
-
9
- &mdash; Mocha 1.11.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 = "RELEASE";
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="file_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</a> &raquo;
40
- <span class="title">File: RELEASE</span>
41
-
42
- </div>
43
-
44
- <div id="search">
45
-
46
- <a class="full_list_link" id="class_list_link"
47
- href="class_list.html">
48
-
49
- <svg width="24" height="24">
50
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
- </svg>
54
- </a>
55
-
56
- </div>
57
- <div class="clear"></div>
58
- </div>
59
-
60
- <div id="content"><div id='filecontents'><h1>Release Notes</h1>
61
-
62
- <h2>1.11.2</h2>
63
-
64
- <h3>External changes</h3>
65
-
66
- <ul>
67
- <li>Fix regression introduced in v1.10.0 that meant <code>Object#inspect</code> was called unnecessarily (368abd98)</li>
68
- <li>Warn when mock object receives invocations in another test - thanks to @nitishr (#442)</li>
69
- <li>Avoid rubocop comments appearing in YARD-generated docs (d8019eed)</li>
70
- </ul>
71
-
72
- <h3>Internal changes</h3>
73
-
74
- <ul>
75
- <li>Replace <code>StubbedMethod#original_method</code> &amp; <code>#original_visibility</code> attribute reader methods with instance variables - thanks to @nitishr (d917f332)</li>
76
- <li>Set up <code>MochaExampleTest</code> &amp; <code>StubbaExampleTest</code> as acceptance tests - thanks to @nitishr (4881cc58)</li>
77
- <li>Delete unused <code>PrettyParameters</code> class - thanks to @nitishr (314ea922)</li>
78
- </ul>
79
-
80
- <h2>1.11.1</h2>
81
-
82
- <h3>External changes</h3>
83
-
84
- <ul>
85
- <li>The <code>reinstate_undocumented_behaviour_from_v1_9</code> configuration option is now enabled by default to give people a chance to see and fix the relevant deprecation warnings before the behaviour is removed in a future release (b91b1c9e)</li>
86
- </ul>
87
-
88
- <h2>1.11.0</h2>
89
-
90
- <h3>External changes</h3>
91
-
92
- <ul>
93
- <li>Add <code>Expectation#with_block_given</code> &amp; <code>Expectation#with_no_block_given</code> (#441).
94
-
95
- <ul>
96
- <li>Allows non-deprecated solution for #382. Thanks to @yemartin for reporting and to @techbelly &amp; @nitishr for feedback.</li>
97
- </ul></li>
98
- <li>Fix issue with non-Array arguments passed to <code>Expectation#multiple_yields</code> (#444).
99
-
100
- <ul>
101
- <li>The undocumented behaviour is now properly supported and documented.</li>
102
- </ul></li>
103
- </ul>
104
-
105
- <h3>Internal changes</h3>
106
-
107
- <ul>
108
- <li>Move static YARD options from Rake task to <code>.yardopts</code> file - thanks to @nitishr (#429)</li>
109
- <li>Simplify implementation of yielding functionality - thanks to @nitishr (#439)</li>
110
- <li>Add missing require statement to <code>acceptance_test_helper.rb</code> (1070fc02)</li>
111
- <li>Add some baseline acceptance tests for yielding behaviour (c2cac911)</li>
112
- <li>Display a sponsor button on GitHub repo page (9fc5911b)</li>
113
- <li>Use new Deprecation.warning behaviour in <code>Invocation#call</code> (932d1166)</li>
114
- </ul>
115
-
116
- <h2>1.10.2</h2>
117
-
118
- <ul>
119
- <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):
120
-
121
- <ul>
122
- <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>
123
- <li>The behaviour of <code>Expectation#yields</code> and <code>Expectation#multiple_yields</code> when the stubbed method is called without a block.</li>
124
- </ul></li>
125
- </ul>
126
-
127
- <h2>1.10.1</h2>
128
-
129
- <ul>
130
- <li>Ensure ObjectMethods &amp; ClassMethods included when API extended (43778756)</li>
131
- <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>
132
- </ul>
133
-
134
- <h2>1.10.0</h2>
135
-
136
- <ul>
137
- <li>Improve deprecation warning when requiring &#39;mocha/setup&#39; (388f44d7)</li>
138
- <li>Add documentation for Cucumber integration (13ab797b)</li>
139
- <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>
140
- </ul>
141
-
142
- <h2>1.10.0.beta.1</h2>
143
-
144
- <ul>
145
- <li>Hide <code>ClassMethods#method_visibility</code> &amp; <code>#method_exists?</code> methods to avoid clash with Rails (#428)</li>
146
- </ul>
147
-
148
- <h2>1.10.0.alpha</h2>
149
-
150
- <h3>External changes</h3>
151
-
152
- <ul>
153
- <li>Remove dependency on metaclass gem (#49, #365)</li>
154
- <li>Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377)</li>
155
- <li>More realistic examples in documentation for <code>Expectation#yields</code> and <code>#multiple_yields</code> - thanks to @nitishr (#352, #383)</li>
156
- <li>Improve documentation for <code>Mock#responds_like</code> &amp; <code>#responds_like_instance_of</code> - thanks to @nitishr (#337, #384)</li>
157
- <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>
158
- <li>Document <code>MOCHA_OPTIONS</code> in README - thanks to @nitishr (#311, #386)</li>
159
- <li>Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385)</li>
160
- <li>Deprecation warning if integration using &#39;mocha/test_unit&#39; or &#39;mocha/minitest&#39; fails - thanks to @nitishr (#229, #389, c6032d0b)</li>
161
- <li>Require at least one specified sequence for <code>Expectation#in_sequence</code> - thanks to @nitishr (#79, #396, 9020248a)</li>
162
- <li>Make signatures of <code>Mock#unstub</code> &amp; <code>ObjectMethods#unstub</code> consistent - thanks to @nitishr (#397, f04d437)</li>
163
- <li>Deprecate requiring &#39;mocha/setup&#39; (36adf880)</li>
164
- <li>Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410)</li>
165
- <li>Put deprecations into effect (#400, #418):
166
-
167
- <ul>
168
- <li>Remove deprecated &#39;mocha_standalone.rb&#39; &amp; &#39;mocha/standalone.rb&#39;</li>
169
- <li>Fail fast if no test library loaded</li>
170
- <li>Removed optional block for <code>Mocha::API#mock</code>, <code>#stub</code> &amp; <code>#stub_everything</code></li>
171
- <li>Remove deprecated <code>ParameterMatchers#has_equivalent_query_string</code> method</li>
172
- <li>Remove deprecated &#39;mocha/mini_test.rb&#39;</li>
173
- </ul></li>
174
- <li>Fix typo in docs for <code>Mocha::Configuration.prevent</code> (266ce71c)</li>
175
- <li>New-style configuration (see documentation for <code>Mocha::Configuration</code>) (#407, #421)</li>
176
- <li>Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d)</li>
177
- <li>Deprecate support for versions of test-unit &amp; minitest which need monkey-patching (a34e1a88)</li>
178
- <li>Deprecate old-style Rails plugin (#403, 2df77134)</li>
179
- <li>Documentation fixes &amp; improvements which also fix YARD warnings (472d5416, a2c0d64a)</li>
180
- </ul>
181
-
182
- <h3>Internal changes</h3>
183
-
184
- <ul>
185
- <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>
186
- <li>Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f)</li>
187
- <li>Only run rubocop for MRI Ruby versions &amp; non-integration test builds (8f1c6af)</li>
188
- <li>Reduce duplication in any instance method class - thanks to @nitishr (#378)</li>
189
- <li>Simplify <code>AnyInstanceMethod</code>, <code>ClassMethod</code>, <code>InstanceMethod</code>, <code>ModuleMethod</code> class hierarchy - thanks to @nitishr (#381)</li>
190
- <li>Simplify <code>ClassMethods#method_exists?</code> &amp; <code>ObjectMethods#method_exists?</code> making them consistent - thanks to @nitishr (#270, #362, #370)</li>
191
- <li>Don&#39;t override definition of <code>singleton_class</code> in <code>ClassMethods</code> - thanks to @nitishr (#391, #392)</li>
192
- <li>Do not include &#39;method_definer&#39; methods into all objects (#268, #402)</li>
193
- <li>Distinguish different <code>ObjectMethods</code> modules (#268, #404)</li>
194
- <li>Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411)</li>
195
- <li>Consistently use <code>assert_raises</code> - thanks to @nitishr (#405, #412, a66b7bed)</li>
196
- <li>Update Ruby &amp; JRuby versions in Travis CI config (18cb1a93, eb061c53)</li>
197
- <li>Rubocop improvements (aa16ea67...6f4db70b, 2a1240e6...e95716ae)</li>
198
- <li>Fix inconsistency in CardinalityTest (aa10e0a8)</li>
199
- <li>Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535)</li>
200
- <li>Remove default argument in <code>Expectation#invoke</code> - thanks to @nitishr (#414, #420)</li>
201
- </ul>
202
-
203
- <h2>1.9.0</h2>
204
-
205
- <ul>
206
- <li>Add TruffleRuby to Travis CI build matrix - thanks to @deepj (#354)</li>
207
- <li>Explicitly set Travis CI OS to Ubuntu Trusty 14.04 (ded1fa45)</li>
208
- <li>Expand explanation of thread-safety concerns - thanks to @techbelly (#357)</li>
209
- <li>Refactor class method and any instance method - thanks to @chrisroos (#358)</li>
210
- <li>Rely on default bundler version in Travis CI builds (3352e9c5)</li>
211
- <li>Fix local build-matrix script (11abe231)</li>
212
- <li>No need to install latest bundler in build-matrix script (8247a894)</li>
213
- </ul>
214
-
215
- <h2>1.8.0</h2>
216
-
217
- <ul>
218
- <li>Constrain rubocop version to avoid breaking Travis CI builds (05e507f5)</li>
219
- <li>Avoid calling Kernel#format from ObjectMethods#mocha_inspect - thanks to @hoffmanilya (#345)</li>
220
- <li>Fix build matrix script (#346)</li>
221
- <li>Avoid deprecation warning in gemspec (4976e0bc)</li>
222
- <li>Removed link to documentation translation (ef428ea2)</li>
223
- <li>Don&#39;t use the new bundler v2 in builds (683ded9b)</li>
224
- <li>Moved documentation from <a href="https://gofreerange.com/mocha/docs">https://gofreerange.com/mocha/docs</a> to <a href="https://mocha.jamesmead.org/">https://mocha.jamesmead.org/</a> <a href="https://github.com/freerange/mocha/compare/683ded...a17fde">683ded...a17fde</a></li>
225
- </ul>
226
-
227
- <h2>1.7.0</h2>
228
-
229
- <ul>
230
- <li>Update Ruby &amp; JRuby versions in Travis CI config (9bf55631 &amp; 3883af7e)</li>
231
- <li>Simplify gemspec (63744f86)</li>
232
- <li>Add rubocop and fix most cop violations (#341)</li>
233
- <li>Use Kernel#warn for deprecations - thanks to @etiennebarrie (#333, 196970a)</li>
234
- </ul>
235
-
236
- <h2>1.6.0</h2>
237
-
238
- <ul>
239
- <li>Fix subtle bug in setting correct visibility of stubbed module methods on <code>Kernel</code> or <code>Object</code> - thanks to @chrisroos (#295)</li>
240
- <li>Avoid mocks for partial mocking leaking into subsequent tests - thanks to @skliew for reporting (#331)</li>
241
- <li>Remove OpenCollective badge, backers &amp; sponsors (a283a079)</li>
242
- <li>Change gem version badge to SVG format and add SemVer stability badge - thanks to @greysteil (#335)</li>
243
- <li>Improve documentation for Configuration (#236)</li>
244
- </ul>
245
-
246
- <h2>1.5.0</h2>
247
-
248
- <ul>
249
- <li>Prevent use of Mocha outside the context of a test/example - thanks to @andyw8 &amp; @lzap (#327)</li>
250
- </ul>
251
-
252
- <h2>1.4.0</h2>
253
-
254
- <ul>
255
- <li>Fix deprecation warning for <code>assert_nil</code> in <code>ClassMethodTest</code> (#308 &amp; #309)</li>
256
- <li>Display file and line number in deprecation warning - thanks to @chrisarcand (#310, #312 &amp; #313)</li>
257
- <li>Rename <code>mocha/mini_test.rb</code> to <code>mocha/minitest.rb</code> - thanks to @grosser (#320 &amp; #322)</li>
258
- <li>Fix warning when delegating to mock in Ruby 2.4 - thanks to @tjvc (#321 &amp; #323)</li>
259
- <li>Updates to Travis CI configuration (<a href="https://github.com/freerange/mocha/compare/73af600...9732726">73af600..9732726</a> &amp; 0426e5e)</li>
260
- </ul>
261
-
262
- <h2>1.3.0</h2>
263
-
264
- <ul>
265
- <li>Ensure all tests run individually - thanks to @chrisroos (#267)</li>
266
- <li>Update Travis CI build status badge to show master branch status (#264)</li>
267
- <li>Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)</li>
268
- <li>Fix pretty printing of quotes in <code>String#mocha_inspect</code> (#215 &amp; #223)</li>
269
- <li>Add release instructions to README - thanks to @chrisroos (70a5febd &amp; 3c664df7)</li>
270
- <li>Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)</li>
271
- <li>Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos (8f58eddf)</li>
272
- <li>Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 &amp; eca7560c)</li>
273
- <li>Fix JRuby build - thanks to @headius (jruby/jruby#4250) &amp; @chrisroos (#274)</li>
274
- <li>Add latest stable version of JRuby to Travis CI build matrix (#288)</li>
275
- <li>Fix Ruby v1.8.7 builds on Travis CI (928b5a40 &amp; 460dce5b)</li>
276
- <li>Deprecate passing block to mock object constructor (#290)</li>
277
- <li>Add a known issue to README for Ruby bug 12876 (#276)</li>
278
- <li>Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga (#297)</li>
279
- <li>Fix <code>Mocha::ParameterMatchers#includes</code> for <code>Array</code> values - thanks to @timcraft (#302)</li>
280
- <li>Use faster container-based virtual environments for Travis CI builds (#305)</li>
281
- <li>Rename <code>Mocha::ParameterMatchers::QueryStringMatches</code> to <code>QueryString</code> (#306)</li>
282
- <li>Handle blank parameter value for query string matcher - thanks to @weynsee (#303 &amp; #304)</li>
283
- <li>Rename <code>Mocha::ParameterMatchers::QueryString</code> -&gt; <code>EquivalentUri</code> (#307)</li>
284
- <li>Use <code>do ... end</code> instead of <code>{ ... }</code> in acceptance tests - thanks to @chrisroos (#294)</li>
285
- </ul>
286
-
287
- <h2>1.2.1</h2>
288
-
289
- <ul>
290
- <li>Fixed #272. Workaround Ruby bug 12832 which caused interpreter to hang. See <a href="https://bugs.ruby-lang.org/issues/12832">https://bugs.ruby-lang.org/issues/12832</a>. Thanks to @chrisroos &amp; @petems (6f1c8b9b, #273).</li>
291
- </ul>
292
-
293
- <h2>1.2.0</h2>
294
-
295
- <ul>
296
- <li>Always use prepended module to stub class &amp; instance methods for Ruby v2+ - thanks to @grosser &amp; @chrisroos (43d56671, #244)</li>
297
- <li>Always use prepended module to stub AnyInstance methods in Ruby v2+ - thanks to @chrisroos (#262)</li>
298
- <li>Always set visibility of stub method to match stubbed method on included module - thanks to @grosser &amp; @chrisroos (e87c03b0, #248)</li>
299
- <li>Always set visibility to stub method to match stubbed method on superclass - thanks to @chrisroos (38d902ad)</li>
300
- <li>Allow stubbing of method to which any instance responds (#200)</li>
301
- <li>Allow <code>includes</code> matcher to take matcher arguments - thanks to @lazyatom (#217)</li>
302
- <li>Avoid exception in older version of Rubygems - thanks to @chrisroos (78d930a7)</li>
303
- <li>Add licenses to gemspec as requested by @coreyhaines (#201)</li>
304
- <li>Fix typo in README - thanks to @jaredbeck (6119460d)</li>
305
- <li>Added section about using Mocha with RSpec &amp; Rails to README (#221)</li>
306
- <li>Fix documentation for Mocha::API#stub method - thanks to @raeno (599b1dcd)</li>
307
- <li>Added backers and sponsors from OpenCollective - thanks to @piamancini (#253)</li>
308
- <li>Fix typo in docs for equals - thanks to @alexcoco (#254)</li>
309
- <li>Add known issue for Ruby v1.8 to README - thanks to @chrisroos (2c642096)</li>
310
- </ul>
311
-
312
- <h2>1.1.0</h2>
313
-
314
- <ul>
315
- <li>Set visibility of any instance stub method.</li>
316
- <li>Stub methods with a prepended method if there are other prepended methods. Thanks to @mrsimo.</li>
317
- <li>Improve docs for <code>Mock#responds_like</code> &amp; <code>#responds_like_instance_of</code>.</li>
318
- <li>Use GitHub convention for instructions on contributing to Mocha.</li>
319
- <li>Fix typos in docs. Thanks to @10io</li>
320
- </ul>
321
-
322
- <h2>1.0.0</h2>
323
-
324
- <h3>External changes</h3>
325
-
326
- <ul>
327
- <li>Assume &#39;mocha&#39; has been required when requiring &#39;mocha/setup&#39;.</li>
328
- <li>Provide shortcuts for integrating with specific test library i.e. <code>require &#39;mocha/test_unit&#39;</code> or <code>require &#39;mocha/mini_test&#39;</code>
329
- as alternatives to <code>require &#39;mocha/setup&#39;</code>.</li>
330
- <li>Do not automatically try to integrate with test libraries. Since the automatic test library integration functionality
331
- requires the test library to be loaded and this doesn&#39;t usually happen until <em>after</em> the bundle is loaded, it makes things
332
- simpler if we use <code>require &#39;mocha/setup&#39;</code> to explicitly setup Mocha when we know the test library has been loaded. Fixes #146 &amp; #155.</li>
333
- <li>Consider stubs on superclasses if none exist on primary receiver. Largely based on changes suggested by @ccutrer in #145.
334
- Note: this may break existing tests which rely on the old behaviour. Stubbing a superclass method and then invoking that
335
- method on a child class would previously cause an unexpected invocation error. By searching up through the inheritance
336
- hierarchy for each of the delegate mock objects, we can provide more intuitive behaviour. Instead of an unexpected invocation
337
- error, invoking the method on the child class will cause the stubbed method on the superclass to be used.</li>
338
- <li>Avoid recursion when constructing unexpected invocation message. Fixes #168.</li>
339
- <li>Add explanation of method dispatch. Heavily based on the relevant jMock v1 documentation. Fixes #172.</li>
340
- <li>Make class_eval line number more accurate. This sets the line number as the line number of the <code>def</code> statement. Closes #169.</li>
341
- <li>Allow nesting of <code>responds_with</code> parameter matcher. Closes #166.</li>
342
- <li>Define <code>Mocha</code> module before it&#39;s referenced. The test helper defines a class <code>TestCase</code> within the <code>Mocha</code> module. When
343
- running the tests inside the bundle, the <code>Mocha</code> module happens to be defined at this point. However when running the tests outside the bundle, it is not defined and so an exception is raised: <code>uninitialized constant Mocha (NameError)</code>. Fixes #163.</li>
344
- <li>Document lack of thread-safety. Fixes #154.</li>
345
- <li>Document how to use the build-matrix script. Fixes #160.</li>
346
- <li>Stubbing non-public method should use same visibility. This will probably break some existing tests that were somehow relying
347
- on the stubbed method being public while the original method was protected or private. Fixes #150.</li>
348
- </ul>
349
-
350
- <h3>Internal changes</h3>
351
-
352
- <ul>
353
- <li>Use lastest Rubygems in Travis CI builds.</li>
354
- <li>Run the standard test suite against Ruby 2.1.0 in the build matrix.</li>
355
- <li>Run integration tests against Ruby 2.0.0 with latest Test::Unit gem in the build matrix.</li>
356
- <li>Test::Unit is not available in Ruby v1.9.3 standard library, so remove it from the build matrix.</li>
357
- <li>Force use of Test::Unit runner, etc in relevant integration tests. Prior to this, I don&#39;t think we were really testing the
358
- Mocha integration with Test::Unit much, because, although <code>TestUnitTest</code> was a subclass of <code>Test::Unit::TestCase</code>, the
359
- important test case instances are the temporary ones built by <code>TestRunner#run_as_test</code> et al. Prior to this change, these
360
- would only have used Test::Unit where MiniTest was not available <em>at all</em> i.e. only in early versions of Ruby and when the
361
- MiniTest gem was not loaded.</li>
362
- <li>Reset environment variables between build matrix builds.</li>
363
- <li>Only activate integration with relevant test library for each of the integration tests.</li>
364
- <li>Include standard build combinations from Travis CI config i.e. builds using standard library versions of test libraries.</li>
365
- <li>Fix <code>build-matrix.rb</code> script. Also use <code>.travis.yml</code> to decide what combinations to run. This means we
366
- can now simulate the Travis CI build locally and avoid duplication. Fixes #157.</li>
367
- <li>Remove Ruby version map from build matrix script. I&#39;m using the <code>rbenv-aliases</code> plugin to alias minor versions to the
368
- relevant patch version.</li>
369
- </ul>
370
-
371
- <h2>0.14.0</h2>
372
-
373
- <ul>
374
- <li>Official support for MiniTest v5. All tests now pass on the continuous integration build.</li>
375
- </ul>
376
-
377
- <h2>0.14.0.alpha</h2>
378
-
379
- <ul>
380
- <li>Add speculative support for Minitest v5. Due to incompatibilities it has not yet been possible to run the Mocha test suite against Minitest v5. However, @zenspider (author of Minitest) provided the patch and he has tested it against Rails v4. Fixes #156. Thanks to @zenspider.</li>
381
- <li>Documentation updates.</li>
382
- </ul>
383
-
384
- <h2>0.13.3</h2>
385
-
386
- <ul>
387
- <li>Allow <code>Mocha::ParameterMatchers#includes</code> to accept multiple items. Thanks to @simao.</li>
388
- <li>Allow stubbing of <em>private</em> <code>Kernel</code> methods. Fixes #134. Thanks to @camski for reporting.</li>
389
- <li>Avoid a warning when <code>test/unit/version</code> is required by other libraries in the same project. Fixes #140. Thanks to @tmiller.</li>
390
- <li>Make auto-activation of Test::Unit integration more resilient. This change is specifically to cope with the nasty re-defining of classes that is done by the <code>minitest-spec-rails</code> gem. Fixes #143. Thanks to @tubaxenor for reporting.</li>
391
- <li>Safer restoration of stubbed method visibility. Fixes #141. Thanks to @tmm1.</li>
392
- <li>Ensure <code>Mockery</code> instance gets reset even if exception raised. Fixes #144.</li>
393
- <li>Adapt Mocha acceptance tests to cope with changes in output from latest (v4.6.2) of MiniTest.</li>
394
- <li>Updates to README about Rails compatibility.</li>
395
- </ul>
396
-
397
- <h2>0.13.2</h2>
398
-
399
- <ul>
400
- <li>Stubbing of methods re-declared with different visibilty. Fixes #109.</li>
401
- <li>Add <code>Mock#responds_like_instance_of</code>. Fixes #119.</li>
402
- <li>Make <code>Expectation#inspect</code> less verbose and more useful. Fixes #122.</li>
403
- <li>Make unit tests more robust to changes in environment. Fixes #121.</li>
404
- <li>Update README in an attempt to head Rails-related issues off at the pass.</li>
405
- <li>Add a Gem Badge to provide a link to Mocha on Rubygems.</li>
406
- <li>Make documentation example consistent with other examples.</li>
407
- </ul>
408
-
409
- <h2>0.13.1</h2>
410
-
411
- <ul>
412
- <li>Fix #97 - <code>Mocha::ParameterMatchers#has_entry</code> does not work with an Array as the entry&#39;s value. Thanks to @ngokli.</li>
413
- <li>Allow deprecation <code>:debug</code> mode to be switched on from <code>MOCHA_OPTIONS</code> environment variable.</li>
414
- </ul>
415
-
416
- <h2>0.13.0</h2>
417
-
418
- <ul>
419
- <li>Major overhaul of MiniTest &amp; Test::Unit integration. Mocha now integrates with later versions of the two test libraries using documented hooks rather than monkey-patching. This should mean that Mocha will integrate with new versions of either library without the need to release a new version of Mocha each time, which was clearly bad and unsustainable. Many thanks to @tenderlove, @zenspider &amp; @kou for their help, suggestions &amp; patience.</li>
420
- <li>Temporarily deprecated <code>require &#39;mocha&#39;</code>. Use <code>require &#39;mocha/setup&#39;</code> instead. The plan is that eventually <code>require &#39;mocha&#39;</code> will <em>not</em> automatically integrate with either of the two test libraries as it does at the moment, and you&#39;ll need to explicitly &amp; separately trigger the integration. I think this will provide a lot more flexibility and will hopefully do away with the need for the <code>require: false</code> option in the <code>Gemfile</code> which has always confused people.</li>
421
- <li>Deprecated <code>require &#39;mocha_standalone&#39;</code> and <code>require &#39;mocha/standalone&#39;</code>. Use <code>require &#39;mocha/api</code> instead.</li>
422
- <li>Although these are not part of Mocha&#39;s public API, I thought I should mention that the MiniTest and Test::Unit assertion counter classes have been combined into a single class <code>Mocha::Integration::AssertionCounter</code>.</li>
423
- <li>Extracted Mocha::Hooks module from Mocha::API and added documentation for test library authors.</li>
424
- <li>Improvements to documentation. Much of it has been combined into the README file.</li>
425
- <li>Fix #101 - Mock#respond_to? doesn&#39;t work with a string argument - thanks to @urbanautomaton.</li>
426
- <li>Fix #105 - Travis link in README - thanks to @cknadler.</li>
427
- <li>Various improvements to automated testing of integration with test libraries.</li>
428
- <li>Make deprecation warnings more prominent.</li>
429
- </ul>
430
-
431
- <h2>0.12.7</h2>
432
-
433
- <ul>
434
- <li>Officially support minitest v4.1.0 (still monkey-patching).</li>
435
- </ul>
436
-
437
- <h2>0.12.6</h2>
438
-
439
- <ul>
440
- <li>Fixes #103.</li>
441
- </ul>
442
-
443
- <h2>0.12.5</h2>
444
-
445
- <ul>
446
- <li>Officially support minitest v3.5.0 (still monkey-patching).</li>
447
- </ul>
448
-
449
- <h2>0.12.4</h2>
450
-
451
- <ul>
452
- <li>Officially support minitest v3.4.0 &amp; test-unit v2.5.2 (still monkey-patching).</li>
453
- </ul>
454
-
455
- <h2>0.12.3</h2>
456
-
457
- <ul>
458
- <li>Revert rename of undocumented internal module since it turns out Rails/ActiveSupport is relying on its existence.</li>
459
- </ul>
460
-
461
- <h2>0.12.2</h2>
462
-
463
- <ul>
464
- <li>Officially support minitest v3.3.0 (still monkey-patching)</li>
465
- </ul>
466
-
467
- <h2>0.12.1</h2>
468
-
469
- <ul>
470
- <li>Deprecation warning (instead of fail fast) if neither Test::Unit nor MiniTest is loaded. Fixes #88.</li>
471
- <li>Remove deprecated access to <code>Mocha::Standalone</code>.</li>
472
- <li>Remove the deprecated file <code>stubba.rb</code>.</li>
473
- <li>Officially support test-unit v2.5.1 (still monkey-patching).</li>
474
- <li>Improve the API acceptance test.</li>
475
- </ul>
476
-
477
- <h2>0.12.0</h2>
478
-
479
- <ul>
480
- <li>Fail fast if neither Test::Unit nor MiniTest is loaded. Fixes #40.</li>
481
- <li>Officially support MiniTest up to v3.2.0 (still monkey-patching).</li>
482
- <li>Officially support test-unit v2.5.0 (still monkey-patching).</li>
483
- <li>Do not monkey-patch Test::Unit or MiniTest unless we <em>know</em> it&#39;s ok.</li>
484
- <li>Add acceptance tests to demonstrate using a block as a custom parameter matcher.</li>
485
- <li>Update Travis CI build status image to use the new build under the freerange account.</li>
486
- </ul>
487
-
488
- <h2>0.11.4</h2>
489
-
490
- <ul>
491
- <li>Homepage has moved to <a href="http://gofreerange.com/mocha/docs">http://gofreerange.com/mocha/docs</a>.</li>
492
- </ul>
493
-
494
- <h2>0.11.3</h2>
495
-
496
- <ul>
497
- <li>Fix for #78 i.e. alias Object#method as Object#<em>method, not Object#</em><em>method</em>_ which already exists as another Ruby method.</li>
498
- </ul>
499
-
500
- <h2>0.11.2</h2>
501
-
502
- <ul>
503
- <li>Rails has a Request class which defines its own #method method. This broke the new mechanism for stubbing a method. This release includes a slightly modified version of fix #77 provided by @sikachu. See <a href="https://github.com/rails/rails/pull/5907">https://github.com/rails/rails/pull/5907</a> for further info.</li>
504
- </ul>
505
-
506
- <h2>0.11.1</h2>
507
-
508
- <ul>
509
- <li>In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76.</li>
510
- </ul>
511
-
512
- <h2>0.11.0</h2>
513
-
514
- <ul>
515
- <li>Store original method when stubbing rather than using alias_method. This fixes #41, #47, #74 and all tests now pass on both Ruby 1.8.7 and 1.9.3.</li>
516
- <li>Attempting to stub a method on a frozen object should fail fast. See #68.</li>
517
- <li>Prevent stubbing a method on nil by default. See #68.</li>
518
- <li>Generate documentation using YARD instead of Rdoc - removes dependency on Coderay.</li>
519
- <li>Publish documentation on Github pages instead of Rubyforge - uses rake task written by @tomafro.</li>
520
- <li>Remove agiledox which has outlived it&#39;s usefulness.</li>
521
- <li>Removed trailing whitespace throughout codebase.</li>
522
- <li>Add documentation for Mock#unstub.</li>
523
- <li>Improve documentation for ObjectMethods.</li>
524
- <li>Provide a way to run multiple tests within a single acceptance test method.</li>
525
- </ul>
526
-
527
- <h2>0.10.5</h2>
528
-
529
- <ul>
530
- <li>Fix for issue #66 (hopefully without regressing on issue #63) - Mocha::Mock has Mocha::Mockery as a dependency. Stop trying to pretend otherwise. Thanks to @kennyj for reporting.</li>
531
- <li>Fix a bunch of warnings in Ruby 1.9. There are still the 6 test failures mentioned in issue #41 which I suspect are due to the introspection gem not being Ruby 1.9-compatible.</li>
532
- <li>Add links to README for source code &amp; issue tracker.</li>
533
- <li>Fix for issue #67 - Make the travis-ci badge visible in the README. Thanks to Diego Plentz for pull request.</li>
534
- <li>Fix for issue #70 - Rename Mock#expectations to Mock#<strong>expectations</strong> to avoid conflicts. Thanks to Jeremy Stephens for pull request.</li>
535
- </ul>
536
-
537
- <h2>0.10.4</h2>
538
-
539
- <ul>
540
- <li>Fix for issue #65 - expectations not being verified in subsequent tests.</li>
541
- <li>Fix for issue #63 - require Mocha::Mockery at Mocha::Mock class load time and not on invocation of Mock#method_missing.</li>
542
- <li>Fix for issue #45 - raise ArgumentError if Mocha::ParameterMatchers#has_entry is given
543
- Hash with wrong number of entries.</li>
544
- <li>Make global variable name more obscure to avoid clashes with other libraries.</li>
545
- <li>Move travis-ci-related gemfiles into their own directory.</li>
546
- </ul>
547
-
548
- <h2>0.10.3</h2>
549
-
550
- <ul>
551
- <li>Fix for issue #57. Gem::Requirement#=~ was only added in rubygems v1.8.0, but Object#=~ means the result of various monkey-patching checks is always false/nil for earlier versions of rubygems. However, the method it aliases #satisfied_by? has existed since Gem::Dependency was extracted from Gem::Version in rubygems v0.9.4.4, so it&#39;s much safer to use that. Thanks to fguillen for reporting and helping with diagnosis.</li>
552
- </ul>
553
-
554
- <h2>0.10.2</h2>
555
-
556
- <ul>
557
- <li>Merge pull request #53. Unstubbing a method should not remove expectations for other stubbed methods. Fixes #52. Thanks to saikat.</li>
558
- </ul>
559
-
560
- <h2>0.10.1</h2>
561
-
562
- <ul>
563
- <li>Merge pull request #51. Use Gem::Requirement &amp; Gem::Version for version comparison. Fixes issue #50. Thanks to meineerde.</li>
564
- <li>Fixed typo in rdoc for Mocha::ObjectMethods.</li>
565
- <li>Improve README as suggested in issue #46. Explain that Mocha must be loaded after test libraries and how to achieve this using Bundler.</li>
566
- <li>Merge pull request #43 - nobody expects the spanish inquisition! Thanks to cairo140.</li>
567
- <li>Fix for issue #39 - improve documentation for Expectation#multiple_yields.</li>
568
- <li>Fix for issue #38 where a subtle change in test-unit v2.3.0 had been missed - only visible in verbose mode.</li>
569
- <li>Support for MiniTest up to v2.6.2 has been verified.</li>
570
- <li>Add explicit development dependency on coderay for generating syntax-highlighted code examples.</li>
571
- </ul>
572
-
573
- <h2>0.10.0</h2>
574
-
575
- <ul>
576
- <li>Add Expectation#throws to allow a stubbed method to use Kernel#throw.</li>
577
- <li>Updates for versions of Test::Unit up to and including v2.3.3 (including patch by Jens Fahnenbruck).</li>
578
- <li>Updates for versions of MiniTest up to and including v2.5.1.</li>
579
- <li>Since the singleton method added by Mocha masks the underlying instance method, there&#39;s no need to move it out the way and then back again. This fixes Github issue #20, because the original method is left unchanged - <a href="https://github.com/floehopper/mocha/issues/20">https://github.com/floehopper/mocha/issues/20</a> (thanks to Nick Lewis).</li>
580
- <li>Handle stubbing of a singleton method, leaving the original method unchanged after the test.</li>
581
- <li>When stubbing an instance method that was originally defined as a singleton method, the original method should still exist after the test.</li>
582
- <li>Fixed mis-print in Mocha::ObjectMethods#unstub documentation (patch by Gleb Pomykalov).</li>
583
- <li>Improved test coverage around stubbing of methods defined in different ways - this makes use of the newly extracted introspection gem (although this means some tests are now failing in Ruby v1.9.2).</li>
584
- <li>Added configuration for Travis continuous integration.</li>
585
- <li>Make the gemspec the canonical reference and stop generating it from the Rakefile.</li>
586
- <li>Use the built-in Bundler rake tasks for packaging the gem.</li>
587
- <li>Use the &quot;release&quot; rake task provided by Bundler instead of using the Rake::XForge::Release functionality.</li>
588
- <li>Extract Object#<strong>metaclass</strong> into a new metaclass gem.</li>
589
- <li>Run rake tasks without <code>bundle exec</code>.</li>
590
- <li>Avoid deprecation warning for rdoc rake task.</li>
591
- <li>Remove the <code>use_test_unit_gem</code> MOCHA_OPTION which hasn&#39;t worked since we switched to bundler - we can now run the tests specifying a different Gemfile instead.</li>
592
- <li>Use multiple Gemfiles seems to run Travis CI builds against multiple version of test-unit &amp; minitest.</li>
593
- </ul>
594
-
595
- <h2>0.9.12</h2>
596
-
597
- <ul>
598
- <li>Make Mocha&#39;s tests pass under Ruby 1.9.2 i.e. using MiniTest. One of the main issues was that we were not parsing stacktraces on MiniTest errors comprehensively enough.</li>
599
- <li>Avoid &#39;circular require considered harmful&#39; warning when running Mocha&#39;s tests in Ruby 1.9.2</li>
600
- <li>Make performance tests work on Ruby 1.9.2 i.e. using MiniTest.</li>
601
- <li>Declare rake as a <em>development</em> dependency with newer versions of Rubygems since it&#39;s only needed to carry out developer-related tasks.</li>
602
- </ul>
603
-
604
- <h2>0.9.11</h2>
605
-
606
- <ul>
607
- <li>Added explicit support for minitest v1.5.0 to v2.0.2.</li>
608
- <li>Make testable by rubygems-test.</li>
609
- <li>Update links to my blog and make other links consistent.</li>
610
- <li>Added a URI parameter matcher that ignores the order of query parameters so that tests can be independent of undefined hash ordering (patch by Paul Battley).</li>
611
- <li>Include unexpected invocation in failure message and change the language slightly to make the failure message less confusing. See <a href="http://floehopper.lighthouseapp.com/projects/22289/tickets/52">http://floehopper.lighthouseapp.com/projects/22289/tickets/52</a>.</li>
612
- <li>No need to create regular expression every time the BacktraceFilter#filtered method is called. See <a href="http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/66">http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/66</a>.</li>
613
- </ul>
614
-
615
- <h2>0.9.10</h2>
616
-
617
- <ul>
618
- <li>Added Mocha::ObjectMethods#unstub method - <a href="https://github.com/floehopper/mocha/issues#issue/6">https://github.com/floehopper/mocha/issues#issue/6</a></li>
619
- <li>Inherit Mocha::ExpectationError from Exception instead of StandardError to reduce the chances of a test passing by accident - thanks to James Sanders (jsanders) - <a href="https://github.com/floehopper/mocha/issues#issue/15">https://github.com/floehopper/mocha/issues#issue/15</a></li>
620
- <li>Fixed bug - GitHub README page to link correctly to code examples - <a href="https://github.com/floehopper/mocha/issues/closed#issue/11">https://github.com/floehopper/mocha/issues/closed#issue/11</a></li>
621
- <li>Fixed bug - PASSTHROUGH_EXCEPTIONS are defined on MiniTest::Unit::TestCase not in Mocha - thanks to Brian Troutwine (blt) - <a href="https://github.com/floehopper/mocha/issues/closed#issue/14">https://github.com/floehopper/mocha/issues/closed#issue/14</a></li>
622
- </ul>
623
-
624
- <h2>0.9.9</h2>
625
-
626
- <ul>
627
- <li>Avoid loading bits of the test-unit gem by accident. This is an attempt at a fix for the problem that James Adam reported [1]. By using &#39;load&#39; instead of &#39;require&#39; to detect the version of Test::Unit, we can avoid rubygems trying to load bits of the test-unit gem when it&#39;s not wanted. [1] <a href="http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/50#ticket-50-13">http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/50#ticket-50-13</a></li>
628
- <li>Fix exception when running rake without test-unit gem. When test-unit gem &gt;=v2.0.0 was installed but the &quot;use_test_unit_gem&quot; MOCHA_OPTIONS was not specified, a &quot;comparison of Fixnum with Hash failed&quot; exception was being raised when running the performance tests. This was because bits of the test-unit gem were being loaded accidentally and a Hash was being incorrectly supplied to the TestRunner.run method.</li>
629
- <li>Explicitly require rubygems for running tests via rake using test-unit gem.</li>
630
- <li>Handle newer versions of test-unit gem (v2.0.2 to v2.0.9)</li>
631
- <li>Handle newer versions of minitest gem (v1.4.0 to v1.6.0)</li>
632
- <li>Added warnings about monkey-patching test-unit and minitest to aid debugging. These are enabled by including &quot;debug&quot; in the MOCHA_OPTIONS environment variable. This is now a comma-separated list, so that we can specify multiple options e.g. MOCHA_OPTIONS=debug,use_test_unit_gem</li>
633
- <li>Eloy Duran (alloy) made the unit tests run on 1.9.2dev r25249.</li>
634
- <li>Eloy Duran (alloy) also improved some MiniTest TestResult code I&#39;d written and got the acceptance tests running on Ruby 1.9 HEAD. There are still 4 failures because for some reason the backtrace line numbers are off by one. And the minitest_test test case does not run when the whole suite is run with MiniTest. These issues still need investigation.</li>
635
- <li>Fixed some acceptance tests to run in Ruby 1.9.2 - it&#39;s no longer possible to subvert the protection of a method by calling it via Object#send.</li>
636
- <li>Fixed &quot;test:performance&quot; rake task so it runs in Ruby 1.9.2.</li>
637
- <li>Fix test incorrectly failing under Rubinius 1.0. This test imposed too many constraints. It appears that Object#inspect legitimately calls Object#object_id in Rubinius. But we&#39;re only interested in what &#39;id&#39; methods Mocha::ObjectMethods#mocha_inspect calls. By stubbing Object#inspect we can relax the constraints imposed by the test.</li>
638
- <li>Luke Redpath (lukeredpath) added new shorthand &quot;any&quot; and &quot;all&quot; composite parameter matchers using &quot;&amp;&quot; and &quot;|&quot;. This provides an alternative syntax for expecting any or all matchers to pass, e.g. foo.expects(:bar).with(equals(1) | equals(2)).</li>
639
- <li>Improved documentation for Expectation#raises. A number of people have suggested an extension to the API to cope with custom exceptions that have extra constructor parameters. However, since the arguments supplied to Expectation#raises are just passed on to Kernel#raise, it&#39;s possible to pass in an instance of an exception. Thus no change to the API is required, but it does seem worthwhile pointing this out in the docs.</li>
640
- <li>Corrected RDoc example for Expectation#never thanks to Red David (reddavis).</li>
641
- <li>Improved RDoc including a change suggested by Rohit Arondekar (rohit).</li>
642
- <li>Updated gemspec as requested by Sam Woodard (shwoodard).</li>
643
- </ul>
644
-
645
- <h2>0.9.8</h2>
646
-
647
- <ul>
648
- <li>Fixed bug &quot;NameError raised when using Mocha as a Rails plug-in&quot; - <a href="http://floehopper.lighthouseapp.com/projects/22289/tickets/53">http://floehopper.lighthouseapp.com/projects/22289/tickets/53</a>. Since 0.9.6 the Rails plugin has been broken. See bug report for details. You will need to explicitly load Mocha <em>after</em> the test framework has been loaded, e.g. by adding &quot;require &#39;mocha&#39;&quot; at the bottom of test/test_helper.rb.</li>
649
- <li>Make Mocha::ParameterMatchers#regexp_matches, #includes, #has_value, #has_key more robust. Thanks to Sander Hartlage.</li>
650
- <li>Allow passing a block to Mocha::Configuration methods to only change configuration for the duration of the block. Thanks to Dan Manges.</li>
651
- <li>Fixed bug &quot;doc generation fails in 0.9.7 gem&quot; - <a href="http://floehopper.lighthouseapp.com/projects/22289/tickets/51">http://floehopper.lighthouseapp.com/projects/22289/tickets/51</a>.</li>
652
- <li>Remove rdoc template incorporating google analytics from source control. The file just needs to exist locally and be ignored by source control. This should stop the warning showing up on e.g. RunCodeRun build results.</li>
653
- </ul>
654
-
655
- <h2>0.9.7</h2>
656
-
657
- <ul>
658
- <li>Although I had provided a deprecation warning for people using Mocha::Standalone, I had assumed people wouldn&#39;t be explicitly loading the mocha/standalone.rb file. It turns out this assumption was incorrect at least in the case of Rspec. This is now fixed.</li>
659
- </ul>
660
-
661
- <h2>0.9.6</h2>
662
-
663
- <ul>
664
- <li>Version 2.0.1 of the test-unit gem introduced a private &#39;run_test&#39; method on TestCase which clashed with the public TestRunner#run_test method. So this latter method has been renamed to &#39;run_as_test&#39;.</li>
665
- <li>Stop requiring rubygems - this should be an environmental choice for the user. <a href="http://gist.github.com/54177">http://gist.github.com/54177</a> - describes why requiring rubygems in your library code is a bad idea.</li>
666
- <li>It seems like overkill to vendorize coderay and meta_project when they&#39;re only needed to generate the examples for documentation and for publishing files on RubyForge. So I&#39;m removing them and installing them locally as gems when I need them.</li>
667
- <li>Added support for &#39;test-unit&#39; gem (version &gt;= 2.0). Note that as with other versions of Test::Unit I&#39;m completely replacing the TestCase#run method. Unfortunately in version 2.0.0 this method differs slightly from the same method in version 2.0.1 &amp; 2.0.2, so we have to provide different implementations to ensure that the internal working of Test::Unit are not compromised by Mocha. Note also that unless the &#39;test-unit&#39; gem is loaded, requiring &#39;test/unit&#39; leads to a mixture of stdlib and gem classes being loaded causing errors. To avoid a dependency on rubygems, the gem is loaded only if MOCHA_OPTIONS is set to &#39;use_test_unit_gem&#39; - this option is only intended for use in running Mocha&#39;s own tests. It might be worthwhile to create a shim gem like minitest_tu_shim to allow the test-unit gem to completely replace the stdlib, but that&#39;s a job for another day. The changes in the Rakefile are to make the default task run with the &#39;test-unit&#39; gem (version &gt;= 2.0).</li>
668
- <li>Renamed Mocha::Standalone to Mocha::API to better reflect its purpose. Added a deprecation warning for those who are referencing Mocha::Standalone.</li>
669
- <li>Fix exception raised by HasEntry#matches? if first param is not a Hash (thanks to Taylor Barstow).</li>
670
- <li>Ken Collins reported [1] that Mocha is always loading MiniTest if it is available and loading it causes some Rails/ActionPack tests to break. I&#39;ve removed the loading of MiniTest, but this now means the user has to ensure that if they want to use MiniTest in conjunction with Mocha, he must load MiniTest before loading Mocha. [1] <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2060">http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2060</a></li>
671
- <li>Implemented Bacon integration (thanks to Ubiratan Pires Alberton), but this was then removed after deciding only to maintain integration with Test::Unit and MiniTest which are both Ruby standard libraries. See mailing list for details.</li>
672
- <li>Don&#39;t monkey-patch MiniTest if it&#39;s already been monkey-patched by Mocha.</li>
673
- <li>Fixed bug: MiniTest integration was counting ExpectationErrors as errors not failures. <a href="http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/41">http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/41</a>.</li>
674
- <li>Fixed bug: Some Bacon tests were failing in Ruby 1.9.1. <a href="http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/43">http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/43</a>.</li>
675
- <li>Chad Humphries pointed out that in Ruby 1.9.1, if you are not using Test::Unit or MiniTest, Mocha will attempt to load and monkey-patch Test::Unit. Mocha will now only monkey-patch Test::Unit and/or MiniTest if they have already been loaded. MiniTest tests will now run in both Ruby 1.8.6 (with MiniTest gem) and in Ruby 1.9.1 (with MiniTest std lib). See Ligthouse ticket - <a href="http://floehopper.lighthouseapp.com/projects/22289/tickets/49">http://floehopper.lighthouseapp.com/projects/22289/tickets/49</a>.</li>
676
- <li>Made Mocha compatible with minitest 1.4.0 and above (thanks to Denis Defreyne).</li>
677
- </ul>
678
-
679
- <h2>0.9.5</h2>
680
-
681
- <ul>
682
- <li>Fixed Lighthouse bug #32 - stub_everything should mean mock responds to anything.</li>
683
- <li>Added Expectation#twice to improve readability. Thanks to pull request from Celestino Gomes.</li>
684
- <li>In Ruby 1.9.1, requiring &#39;test/unit&#39; loads a thin wrapper around MiniTest and Test::Unit::TestCase ends up inheriting from MiniTest::Unit::TestCase. So we need to avoid including the Mocha modules more than once to avoid nasty consequences. Thanks to Matthias Hennemeyer for help with this.</li>
685
- <li>Ruby 1.9 includes rake, but not rake/contrib. For the moment I&#39;ve moved the sshpublisher require into the only rake task that needs it, so that I can at least run the tests in Ruby 1.9. It looks like I will need to build a rake/contrib gem or similar to get this working properly - <a href="http://intertwingly.net/blog/2008/01/07/Rake-Contrib-for-1-9">http://intertwingly.net/blog/2008/01/07/Rake-Contrib-for-1-9</a></li>
686
- </ul>
687
-
688
- <h2>0.9.4</h2>
689
-
690
- <ul>
691
- <li>Added mocha.gemspec file generated with Chad Woolley&#39;s new rake task, so that a floehopper-mocha gem will get built on GitHub.</li>
692
- <li>Add rake task to update mocha.gemspec with unique version, which will cause gem to be auto-built on github</li>
693
- <li>As Tobias Crawley correctly pointed out in feature request #23055 &quot;stubs(with_hash) not working with existing object&quot; [1], following the principle of least surprise, it should be possible to call ObjectMethods#expects &amp; ObjectMethods#stubs with a Hash of method_names vs return_values like you can with Mock#expects &amp; Mock#stubs. I&#39;ve also updated &amp; improved the docs to reflect the changes. [1] <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=23055&group_id=1917&atid=7480">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=23055&amp;group_id=1917&amp;atid=7480</a></li>
694
- <li>Removed deprecated gem autorequire.</li>
695
- </ul>
696
-
697
- <h2>0.9.3</h2>
698
-
699
- <ul>
700
- <li>Added support for MiniTest thanks to Jeff Smick.</li>
701
- <li>Fixed a possible bug with some of the non-default Configuration options relating to the argument to Object#respond_to?</li>
702
- <li>As per Jay Fields recommendations [1] and with further impetus from a talk at Ruby Manor, any methods added to core classes are now added by including a module. This means that Mocha is a better citizen of the Ruby world and it&#39;s behaviour is more easily extended. [1] <a href="http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html">http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html</a> &amp; <a href="http://blog.jayfields.com/2008/07/ruby-redefine-method-behavior.html">http://blog.jayfields.com/2008/07/ruby-redefine-method-behavior.html</a></li>
703
- <li>Removed deprecated gem autorequire.</li>
704
- </ul>
705
-
706
- <h2>0.9.2</h2>
707
-
708
- <ul>
709
- <li>Improved documentation to address [#22530] &#39;Mock methods with multiple return values not possible?&#39;</li>
710
- <li>respond_with parameter matcher was not available in tests.</li>
711
- <li>Patch [#22630] Fix for a bug in running Rails tests with Ruby 1.8.7. Array#flatten was being called which in turn was checking whether each element responded to #to_ary. This check was using the two parameter version of #respond_to?, but Mock was only defining a one parameter version.</li>
712
- </ul>
713
-
714
- <h2>0.9.1</h2>
715
-
716
- <ul>
717
- <li>Fixed bug #21465 - expects &amp; stubs should support method names as strings (as well as symbols) or fail fast. Convert all expectation method names to a symbol in case they were supplied as a string.</li>
718
- <li>By removing Mock#unexpected_method_called we reduce the number of methods vulnerable to the problem that surfaced in bug #21563.</li>
719
- <li>Fix bug #21563 - stubbing &#39;verified?&#39; method is unsafe. Instance method names on the Mock class should be more obscure.</li>
720
- <li>Performance improvement. StubbaExampleTest goes twice as fast on my local machine.</li>
721
- <li>Added primitive performance test to default rake task.</li>
722
- <li>Fix format of case statements which don&#39;t work in Ruby 1.9 and make others consistent.</li>
723
- <li>There is no point in running (potentially expensive) checks if configuration is set to allow such checks to fail. This is a relatively quick fix in response to Chris McGrath&#39;s performance problems.</li>
724
- <li>Fix for bug #21161 - &#39;uninitialized constant Deprecation in stubba.rb&#39;.</li>
725
- <li>It&#39;s more readable to talk about &#39;once&#39; and &#39;twice&#39; rather than &#39;1 time&#39; and &#39;2 times&#39;.</li>
726
- <li>Fix bug #20883 - never should raise when called to prevent follow up errors. Fail fast when there are no matching invokable expectations and handle the stub_everything case sensibly. This might not be entirely backwards compatible, but I think the benefits outweigh the risks. The most likely change is that a test that was already failing will now fail faster, which doesn&#39;t seem so awful.</li>
727
- </ul>
728
-
729
- <h2>0.9.0</h2>
730
-
731
- <ul>
732
- <li><p>Configurable warnings or errors</p>
733
-
734
- <ul>
735
- <li>when a method on a non-public method is stubbed</li>
736
- <li>when a method on a non-existent method is stubbed</li>
737
- <li>when a method on a non-mock object is stubbed</li>
738
- <li>when a method is stubbed unnecessarily (i.e. the stubbed method is not called during the test)</li>
739
- </ul></li>
740
- <li><p>Improved error messages</p>
741
-
742
- <ul>
743
- <li>User-friendly list of unsatisfied expectations, satisfied expectations and state machines.</li>
744
- <li>Improved readability of cardinality description.</li>
745
- <li>Display sensible failure message for any_instance expectations e.g. &quot;#<a href="AnyInstance:Foo">AnyInstance:Foo</a>.bar - expected calls: 1, actual calls: 0&quot;</li>
746
- </ul></li>
747
- <li><p>Parameter matchers</p>
748
-
749
- <ul>
750
- <li>New to this release</li>
751
- <li>optionally (allows matching of optional parameters if available)</li>
752
- <li>yaml_equivalent (allows matching of YAML that represents the specified object)</li>
753
- <li>responds_with (tests the quack not the duck)</li>
754
- <li>Nesting of parameter matchers is now supported.</li>
755
- </ul></li>
756
- <li><p>Optional block passed into mock initializer is evaluated in the context of the new mock instance and can be used as a shortcut to set up expectations.</p></li>
757
- <li><p>Added JMock-style sequences for constraining the order of expected invocations. See Standalone#sequence and Expectation#in_sequence.</p></li>
758
- <li><p>Added JMock-style states for constraining the order of expected invocations. See Standalone#states, Expectation#then, Expectation#when and StateMachine.</p></li>
759
- <li><p>Compatibility with versions of Ruby</p>
760
-
761
- <ul>
762
- <li>Compatibility with Ruby v1.9. All test errors and warnings fixed.</li>
763
- <li>Nasty fix so that TestCaseAdaptor works consistently with earlier versions of Test::Unit as well as more recent versions.</li>
764
- <li>Added platform to gem specification to avoid bug in rubygems 0.9.5 - see <a href="http://www.dcmanges.com/blog/rubygems-0-9-5-platform-bug">http://www.dcmanges.com/blog/rubygems-0-9-5-platform-bug</a> and <a href="http://rubygems.org/read/chapter/20#platform">http://rubygems.org/read/chapter/20#platform</a>.</li>
765
- <li>Make ExpectationRaiser deal with subclasses of Interrupt which seem to need a message supplied in the raise statement in Ruby 1.8.6 (but not 1.8.4 or 1.9). Not sure this is really Mocha&#39;s responsibility.</li>
766
- </ul></li>
767
- <li><p>Added deprecation warning in stubba.rb which is no longer needed and will be removed.</p></li>
768
- <li><p>Supply positioning information to evals to improve any error messages. See <a href="http://ola-bini.blogspot.com/2008/01/ruby-antipattern-using-eval-without.html">http://ola-bini.blogspot.com/2008/01/ruby-antipattern-using-eval-without.html</a></p></li>
769
- <li><p>Bug fixes</p>
770
-
771
- <ul>
772
- <li>18914 in revision 296 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=18914&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=18914&amp;group_id=1917&amp;atid=7477</a></li>
773
- <li>18917 in revision 295 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=18917&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=18917&amp;group_id=1917&amp;atid=7477</a></li>
774
- <li>18336 in revision 287 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=18336&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=18336&amp;group_id=1917&amp;atid=7477</a></li>
775
- <li>17835 in revision 255 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=17835&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=17835&amp;group_id=1917&amp;atid=7477</a></li>
776
- <li>17412 in revision 242 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=17412&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=17412&amp;group_id=1917&amp;atid=7477</a></li>
777
- <li>15977 in revision 198 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=15977&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=15977&amp;group_id=1917&amp;atid=7477</a></li>
778
- <li>11885 in revision 156 - <a href="http://rubyforge.org/tracker/index.php?func=detail&aid=11885&group_id=1917&atid=7477">http://rubyforge.org/tracker/index.php?func=detail&amp;aid=11885&amp;group_id=1917&amp;atid=7477</a></li>
779
- </ul></li>
780
- </ul>
781
-
782
- <h2>0.5.5</h2>
783
-
784
- <ul>
785
- <li>Renamed Matches parameter matcher to RegexpMatches for clarity.</li>
786
- <li>Added noframes tag to rdoc index to assist Google.</li>
787
- </ul>
788
-
789
- <h2>0.5.4</h2>
790
-
791
- <ul>
792
- <li>Added matches parameter matcher for matching regular expressions.</li>
793
- </ul>
794
-
795
- <h2>0.5.3</h2>
796
-
797
- <ul>
798
- <li>Attempt to fix packaging problems by switching to newer version (1.15.1) of gnutar and setting COPY_EXTENDED_ATTRIBUTES_DISABLE environment variable.</li>
799
- <li>Removed unused ExpectationSequenceError exception.</li>
800
- <li>Added instance_of and kind_of parameter matchers.</li>
801
- <li>Added Google Webmaster meta tag to rdoc template header.</li>
802
- <li>Put Google Webmaster meta tag in the right header i.e. the one for the index page.</li>
803
- </ul>
804
-
805
- <h2>0.5.2</h2>
806
-
807
- <ul>
808
- <li>Fix bug 11885 - &quot;never doesn&#39;t work with stub_everything&quot; submitted by Alexander Lang. In fixing this bug, also fixed undiscoverd bug where expected &amp; actual invocation counts were being incorrectly reported which seems to have been introduced when fixes were added for invocation dispatch (see MockedMethodDispatchAcceptanceTest).</li>
809
- <li>Previously when an expectation did not allow more invocations, it was treated as not matching. Now we prefer matching expectations which allow more invocations, but still match expectations which cannot allow more invocations. I think this may be overcomplicating things, but let&#39;s see how it goes.</li>
810
- </ul>
811
-
812
- <h2>0.5.1</h2>
813
-
814
- <ul>
815
- <li>Fixed bug #11583 &quot;Mocha 0.5.0 throwing unexpected warnings&quot;. Also switched on ruby warning for all rake test tasks. Fixed majority of warnings, but some left to fix.</li>
816
- </ul>
817
-
818
- <h2>0.5.0</h2>
819
-
820
- <ul>
821
- <li>Parameter Matchers - I&#39;ve added a few Hamcrest-style parameter matchers which are designed to be used inside Expectation#with. The following matchers are currently available: anything(), includes(), has_key(), has_value(), has_entry(), all_of() &amp; any_of(). More to follow soon. The idea is eventually to get rid of the nasty parameter_block option on Expectation#with.</li>
822
- </ul>
823
-
824
- <p>object = mock()
825
- object.expects(:method).with(has_key(&#39;key_1&#39;))
826
- object.method(&#39;key_1&#39; =&gt; 1, &#39;key_2&#39; =&gt; 2)
827
- # no verification error raised</p>
828
-
829
- <p>object = mock()
830
- object.expects(:method).with(has_key(&#39;key_1&#39;))
831
- object.method(&#39;key_2&#39; =&gt; 2)
832
- # verification error raised, because method was not called with Hash containing key: &#39;key_1&#39;</p>
833
-
834
- <ul>
835
- <li>Values Returned and Exceptions Raised on Consecutive Invocations - Allow multiple calls to Expectation#returns and Expectation#raises to build up a sequence of responses to invocations on the mock. Added syntactic sugar method Expectation#then to allow more readable expectations.</li>
836
- </ul>
837
-
838
- <p>object = mock()
839
- object.stubs(:method).returns(1, 2).then.raises(Exception).then.returns(4)
840
- object.method # =&gt; 1
841
- object.method # =&gt; 2
842
- object.method # =&gt; raises exception of class Exception
843
- object.method # =&gt; 4</p>
844
-
845
- <ul>
846
- <li>Yields on Consecutive Invocations - Allow multiple calls to yields on single expectation to allow yield parameters to be specified for consecutive invocations.</li>
847
- </ul>
848
-
849
- <p>object = mock()
850
- object.stubs(:method).yields(1, 2).then.yields(3)
851
- object.method { |*values| p values } # =&gt; [1, 2]
852
- object.method { |*values| p values } # =&gt; [3]</p>
853
-
854
- <ul>
855
- <li>Multiple Yields on Single Invocation - Added Expectation#multiple_yields to allow a mocked or stubbed method to yield multiple times for a single invocation.</li>
856
- </ul>
857
-
858
- <p>object = mock()
859
- object.stubs(:method).multiple_yields([1, 2], [3])
860
- object.method { |*values| p values } # =&gt; [1, 2] # =&gt; [3]</p>
861
-
862
- <ul>
863
- <li>Invocation Dispatch - Expectations were already being matched in reverse order i.e. the most recently defined one was being found first. This is still the case, but we now stop matching an expectation when its maximum number of expected invocations is reached. c.f. JMock v1. A stub will never stop matching by default. Hopefully this means we can soon get rid of the need to pass a Proc to Expectation#returns.</li>
864
- </ul>
865
-
866
- <p>object = mock()
867
- object.stubs(:method).returns(2)
868
- object.expects(:method).once.returns(1)
869
- object.method # =&gt; 1
870
- object.method # =&gt; 2
871
- object.method # =&gt; 2
872
- # no verification error raised</p>
873
-
874
- <p># The following should still work...</p>
875
-
876
- <p>Time.stubs(:now).returns(Time.parse(&#39;Mon Jan 01 00:00:00 UTC 2007&#39;))
877
- Time.now # =&gt; Mon Jan 01 00:00:00 UTC 2007
878
- Time.stubs(:now).returns(Time.parse(&#39;Thu Feb 01 00:00:00 UTC 2007&#39;))
879
- Time.now # =&gt; Thu Feb 01 00:00:00 UTC 2007</p>
880
-
881
- <ul>
882
- <li>Deprecate passing an instance of Proc to Expectation#returns.</li>
883
- <li>Explicitly include all Rakefile dependencies in project.</li>
884
- <li>Fixed old Stubba example.</li>
885
- <li>Fix so that it is possible for a stubbed method to raise an Interrupt exception without a message in Ruby 1.8.6</li>
886
- <li>Added responds_like and quacks_like.</li>
887
- <li>Capture standard object methods before Mocha adds any.</li>
888
- <li>Added Expectation#once method to make interface less surprising.</li>
889
- <li>Use Rake::TestTask to run tests. Created three separate tasks to run unit, integration &amp; acceptance tests. Split inspect_test into one file per TestCase. Deleted superfluous all_tests file.</li>
890
- <li>Fiddled with mocha_inspect and tests to give more sensible results on x86 platform.</li>
891
- <li>Fixed bug #7834 &quot;infinite_range.rb makes incorrect assumption about to_f&quot; logged by James Moore.</li>
892
- </ul>
893
-
894
- <h2>0.4.0</h2>
895
-
896
- <ul>
897
- <li>Allow naming of mocks (patch from Chris Roos).</li>
898
- <li>Specify multiple return values for consecutive calls.</li>
899
- <li>Improved consistency of expectation error messages.</li>
900
- <li>Allow mocking of Object instance methods e.g. kind_of?, type.</li>
901
- <li>Provide aliased versions of #expects and #stubs to allow mocking of these methods.</li>
902
- <li>Added at_least, at_most, at_most_once methods to expectation.</li>
903
- <li>Allow expects and stubs to take a hash of method and return values.</li>
904
- <li>Eliminate warning: &quot;instance variable @yield not initialized&quot; (patch from Xavier Shay).</li>
905
- <li>Restore instance methods on partial mocks (patch from Chris Roos).</li>
906
- <li>Allow stubbing of a method with non-word characters in its name (patch from Paul Battley).</li>
907
- <li>Removed coupling to Test::Unit.</li>
908
- <li>Allow specified exception instance to be raised (patch from Chris Roos).</li>
909
- <li>Make mock object_id appear in hex like normal Ruby inspect (patch from Paul Battley).</li>
910
- <li>Fix path to object.rb in rdoc rake task (patch from Tomas Pospisek).</li>
911
- <li>Reverse order in which expectations are matched, so that last expectation is matched first. This allows e.g. a call to #stubs to be effectively overridden by a call to #expects (patch from Tobias Lutke).</li>
912
- <li>Stubba &amp; SmartTestCase modules incorporated into Mocha module so only need to require &#39;mocha&#39; - no longer need to require &#39;stubba&#39;.</li>
913
- <li>AutoMocha removed.</li>
914
- </ul>
915
-
916
- <h2>0.3.3</h2>
917
-
918
- <ul>
919
- <li>Quick bug fix to restore instance methods on partial mocks (for Kevin Clark).</li>
920
- </ul>
921
-
922
- <h2>0.3.2</h2>
923
-
924
- <ul>
925
- <li>Examples added.</li>
926
- </ul>
927
-
928
- <h2>0.3.1</h2>
929
-
930
- <ul>
931
- <li>Dual licensing with MIT license added.</li>
932
- </ul>
933
-
934
- <h2>0.3.0</h2>
935
-
936
- <ul>
937
- <li>Rails plugin.</li>
938
- <li>Auto-verify for expectations on concrete classes.</li>
939
- <li>Include each expectation verification in the test result assertion count.</li>
940
- <li>Filter out noise from assertion backtraces.</li>
941
- <li>Point assertion backtrace to line where failing expectation was created.</li>
942
- <li>New yields method for expectations.</li>
943
- <li>Create stubs which stub all method calls.</li>
944
- <li>Mocks now respond_to? expected methods.</li>
945
- </ul>
946
-
947
- <h2>0.2.1</h2>
948
-
949
- <ul>
950
- <li>Rename MochaAcceptanceTest::Rover#move method to avoid conflict with Rake (in Ruby 1.8.4 only?)</li>
951
- </ul>
952
-
953
- <h2>0.2.0</h2>
954
-
955
- <ul>
956
- <li>Small change to SetupAndTeardown#teardown_stubs suggested by Luke Redpath (<a href="http://www.lukeredpath.co.uk">http://www.lukeredpath.co.uk</a>) to allow use of Stubba with RSpec (<a href="http://rspec.rubyforge.org">http://rspec.rubyforge.org</a>).</li>
957
- <li>Reorganized directory structure and extracted addition of setup and teardown methods into SmartTestCase mini-library.</li>
958
- <li>Addition of auto-verify for Mocha (but not Stubba). This means there is more significance in the choice of expects or stubs in that any expects on a mock will automatically get verified.</li>
959
- </ul>
960
-
961
- <p>So instead of...</p>
962
-
963
- <p>wotsit = Mocha.new
964
- wotsit.expects(:thingummy).with(5).returns(10)
965
- doobrey = Doobrey.new(wotsit)
966
- doobrey.hoojamaflip
967
- wotsit.verify</p>
968
-
969
- <p>you need to do...</p>
970
-
971
- <p>wotsit = mock()
972
- wotsit.expects(:thingummy).with(5).returns(10)
973
- doobrey = Doobrey.new(wotsit)
974
- doobrey.hoojamaflip
975
- # no need to verify</p>
976
-
977
- <p>There are also shortcuts as follows...</p>
978
-
979
- <p>instead of...</p>
980
-
981
- <p>wotsit = Mocha.new
982
- wotsit.expects(:thingummy).returns(10)
983
- wotsit.expects(:summat).returns(25)</p>
984
-
985
- <p>you can have...</p>
986
-
987
- <p>wotsit = mock(:thingummy =&gt; 5, :summat =&gt; 25)</p>
988
-
989
- <p>and instead of...</p>
990
-
991
- <p>wotsit = Mocha.new
992
- wotsit.stubs(:thingummy).returns(10)
993
- wotsit.stubs(:summat).returns(25)</p>
994
-
995
- <p>you can have...</p>
996
-
997
- <p>wotsit = stub(:thingummy =&gt; 5, :summat =&gt; 25)</p>
998
-
999
- <h2>0.1.2</h2>
1000
-
1001
- <ul>
1002
- <li>Minor tweaks</li>
1003
- </ul>
1004
-
1005
- <h2>0.1.1</h2>
1006
-
1007
- <ul>
1008
- <li>Initial release.</li>
1009
- </ul>
1010
- </div><script async src="https://www.googletagmanager.com/gtag/js?id=UA-625523-7"></script>
1011
- <script>
1012
- window.dataLayer = window.dataLayer || [];
1013
- function gtag(){dataLayer.push(arguments);}
1014
- gtag('js', new Date());
1015
-
1016
- gtag('config', 'UA-625523-7');
1017
- </script>
1018
- </div>
1019
-
1020
- <div id="footer">
1021
- Generated on Sat Jan 4 17:36:46 2020 by
1022
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1023
- 0.9.20 (ruby-2.6.5).
1024
- </div>
1025
-
1026
- </div>
1027
- </body>
1028
- </html>