mocha 0.10.5 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. checksums.yaml +7 -0
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +61 -0
  4. data/.rubocop_todo.yml +27 -0
  5. data/.yardopts +24 -0
  6. data/CONTRIBUTING.md +7 -0
  7. data/COPYING.md +3 -0
  8. data/Gemfile +2 -2
  9. data/{MIT-LICENSE.rdoc → MIT-LICENSE.md} +1 -1
  10. data/README.md +363 -0
  11. data/{RELEASE.rdoc → RELEASE.md} +436 -35
  12. data/Rakefile +87 -87
  13. data/gemfiles/Gemfile.minitest.latest +2 -2
  14. data/gemfiles/Gemfile.test-unit.latest +6 -2
  15. data/init.rb +1 -3
  16. data/lib/mocha/any_instance_method.rb +12 -45
  17. data/lib/mocha/api.rb +199 -131
  18. data/lib/mocha/argument_iterator.rb +6 -10
  19. data/lib/mocha/backtrace_filter.rb +1 -5
  20. data/lib/mocha/block_matcher.rb +31 -0
  21. data/lib/mocha/cardinality.rb +77 -66
  22. data/lib/mocha/central.rb +27 -18
  23. data/lib/mocha/change_state_side_effect.rb +3 -7
  24. data/lib/mocha/class_methods.rb +62 -0
  25. data/lib/mocha/configuration.rb +399 -46
  26. data/lib/mocha/debug.rb +12 -0
  27. data/lib/mocha/deprecation.rb +11 -12
  28. data/lib/mocha/detection/mini_test.rb +23 -0
  29. data/lib/mocha/detection/test_unit.rb +27 -0
  30. data/lib/mocha/error_with_filtered_backtrace.rb +13 -0
  31. data/lib/mocha/exception_raiser.rb +8 -10
  32. data/lib/mocha/expectation.rb +290 -151
  33. data/lib/mocha/expectation_error.rb +6 -13
  34. data/lib/mocha/expectation_error_factory.rb +35 -0
  35. data/lib/mocha/expectation_list.rb +22 -22
  36. data/lib/mocha/hooks.rb +42 -0
  37. data/lib/mocha/in_state_ordering_constraint.rb +3 -7
  38. data/lib/mocha/inspect.rb +35 -43
  39. data/lib/mocha/instance_method.rb +12 -21
  40. data/lib/mocha/integration/assertion_counter.rb +13 -0
  41. data/lib/mocha/integration/mini_test/adapter.rb +52 -0
  42. data/lib/mocha/integration/mini_test/exception_translation.rb +1 -7
  43. data/lib/mocha/integration/mini_test/nothing.rb +19 -0
  44. data/lib/mocha/integration/mini_test/version_13.rb +35 -25
  45. data/lib/mocha/integration/mini_test/version_140.rb +35 -26
  46. data/lib/mocha/integration/mini_test/version_141.rb +43 -34
  47. data/lib/mocha/integration/mini_test/version_142_to_172.rb +44 -35
  48. data/lib/mocha/integration/mini_test/version_200.rb +45 -36
  49. data/lib/mocha/integration/mini_test/version_201_to_222.rb +44 -35
  50. data/lib/mocha/integration/mini_test/version_2110_to_2111.rb +70 -0
  51. data/lib/mocha/integration/mini_test/version_2112_to_320.rb +73 -0
  52. data/lib/mocha/integration/mini_test/version_230_to_2101.rb +68 -0
  53. data/lib/mocha/integration/mini_test.rb +51 -49
  54. data/lib/mocha/integration/monkey_patcher.rb +24 -0
  55. data/lib/mocha/integration/test_unit/adapter.rb +50 -0
  56. data/lib/mocha/integration/test_unit/gem_version_200.rb +39 -29
  57. data/lib/mocha/integration/test_unit/gem_version_201_to_202.rb +39 -29
  58. data/lib/mocha/integration/test_unit/gem_version_203_to_220.rb +39 -29
  59. data/lib/mocha/integration/test_unit/gem_version_230_to_250.rb +68 -0
  60. data/lib/mocha/integration/test_unit/nothing.rb +19 -0
  61. data/lib/mocha/integration/test_unit/ruby_version_185_and_below.rb +39 -29
  62. data/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb +40 -30
  63. data/lib/mocha/integration/test_unit.rb +45 -51
  64. data/lib/mocha/integration.rb +6 -33
  65. data/lib/mocha/invocation.rb +77 -0
  66. data/lib/mocha/is_a.rb +0 -2
  67. data/lib/mocha/logger.rb +2 -6
  68. data/lib/mocha/macos_version.rb +5 -0
  69. data/lib/mocha/method_matcher.rb +6 -10
  70. data/lib/mocha/minitest.rb +8 -0
  71. data/lib/mocha/mock.rb +266 -79
  72. data/lib/mocha/mockery.rb +104 -106
  73. data/lib/mocha/names.rb +10 -20
  74. data/lib/mocha/not_initialized_error.rb +7 -0
  75. data/lib/mocha/object_methods.rb +169 -0
  76. data/lib/mocha/parameter_matchers/all_of.rb +18 -14
  77. data/lib/mocha/parameter_matchers/any_of.rb +19 -14
  78. data/lib/mocha/parameter_matchers/any_parameters.rb +14 -13
  79. data/lib/mocha/parameter_matchers/anything.rb +17 -14
  80. data/lib/mocha/parameter_matchers/base.rb +33 -31
  81. data/lib/mocha/parameter_matchers/equals.rb +18 -13
  82. data/lib/mocha/parameter_matchers/equivalent_uri.rb +58 -0
  83. data/lib/mocha/parameter_matchers/has_entries.rb +19 -14
  84. data/lib/mocha/parameter_matchers/has_entry.rb +58 -26
  85. data/lib/mocha/parameter_matchers/has_key.rb +18 -13
  86. data/lib/mocha/parameter_matchers/has_keys.rb +53 -0
  87. data/lib/mocha/parameter_matchers/has_value.rb +18 -13
  88. data/lib/mocha/parameter_matchers/includes.rb +80 -19
  89. data/lib/mocha/parameter_matchers/instance_methods.rb +18 -0
  90. data/lib/mocha/parameter_matchers/instance_of.rb +18 -13
  91. data/lib/mocha/parameter_matchers/is_a.rb +20 -14
  92. data/lib/mocha/parameter_matchers/kind_of.rb +20 -13
  93. data/lib/mocha/parameter_matchers/not.rb +19 -14
  94. data/lib/mocha/parameter_matchers/optionally.rb +23 -17
  95. data/lib/mocha/parameter_matchers/regexp_matches.rb +16 -12
  96. data/lib/mocha/parameter_matchers/responds_with.rb +17 -11
  97. data/lib/mocha/parameter_matchers/yaml_equivalent.rb +15 -9
  98. data/lib/mocha/parameter_matchers.rb +4 -5
  99. data/lib/mocha/parameters_matcher.rb +11 -14
  100. data/lib/mocha/raised_exception.rb +11 -0
  101. data/lib/mocha/receivers.rb +45 -0
  102. data/lib/mocha/return_values.rb +11 -15
  103. data/lib/mocha/ruby_version.rb +4 -0
  104. data/lib/mocha/sequence.rb +21 -17
  105. data/lib/mocha/setup.rb +14 -0
  106. data/lib/mocha/single_return_value.rb +5 -8
  107. data/lib/mocha/singleton_class.rb +9 -0
  108. data/lib/mocha/state_machine.rb +69 -67
  109. data/lib/mocha/stubbed_method.rb +125 -0
  110. data/lib/mocha/stubbing_error.rb +6 -14
  111. data/lib/mocha/test_unit.rb +8 -0
  112. data/lib/mocha/thrower.rb +6 -8
  113. data/lib/mocha/thrown_object.rb +12 -0
  114. data/lib/mocha/version.rb +1 -1
  115. data/lib/mocha/yield_parameters.rb +12 -22
  116. data/lib/mocha.rb +8 -3
  117. data/mocha.gemspec +43 -34
  118. data/yard-templates/default/layout/html/google_analytics.erb +8 -0
  119. data/yard-templates/default/layout/html/setup.rb +5 -0
  120. metadata +123 -268
  121. data/COPYING.rdoc +0 -3
  122. data/README.rdoc +0 -54
  123. data/examples/misc.rb +0 -43
  124. data/examples/mocha.rb +0 -25
  125. data/examples/stubba.rb +0 -64
  126. data/gemfiles/Gemfile.minitest.1.3.0 +0 -7
  127. data/gemfiles/Gemfile.minitest.1.4.0 +0 -7
  128. data/gemfiles/Gemfile.minitest.1.4.1 +0 -7
  129. data/gemfiles/Gemfile.minitest.1.4.2 +0 -7
  130. data/gemfiles/Gemfile.minitest.2.0.0 +0 -7
  131. data/gemfiles/Gemfile.minitest.2.0.1 +0 -7
  132. data/gemfiles/Gemfile.minitest.2.3.0 +0 -7
  133. data/gemfiles/Gemfile.test-unit.2.0.0 +0 -8
  134. data/gemfiles/Gemfile.test-unit.2.0.1 +0 -7
  135. data/gemfiles/Gemfile.test-unit.2.0.3 +0 -7
  136. data/lib/mocha/class_method.rb +0 -98
  137. data/lib/mocha/integration/mini_test/assertion_counter.rb +0 -23
  138. data/lib/mocha/integration/mini_test/version_230_to_262.rb +0 -59
  139. data/lib/mocha/integration/test_unit/assertion_counter.rb +0 -23
  140. data/lib/mocha/integration/test_unit/gem_version_230_to_240.rb +0 -58
  141. data/lib/mocha/module_method.rb +0 -16
  142. data/lib/mocha/multiple_yields.rb +0 -20
  143. data/lib/mocha/no_yields.rb +0 -11
  144. data/lib/mocha/object.rb +0 -223
  145. data/lib/mocha/options.rb +0 -1
  146. data/lib/mocha/parameter_matchers/object.rb +0 -15
  147. data/lib/mocha/parameter_matchers/query_string.rb +0 -47
  148. data/lib/mocha/pretty_parameters.rb +0 -28
  149. data/lib/mocha/single_yield.rb +0 -18
  150. data/lib/mocha/standalone.rb +0 -1
  151. data/lib/mocha/unexpected_invocation.rb +0 -18
  152. data/lib/mocha_standalone.rb +0 -2
  153. data/lib/stubba.rb +0 -4
  154. data/test/acceptance/acceptance_test_helper.rb +0 -41
  155. data/test/acceptance/api_test.rb +0 -139
  156. data/test/acceptance/bug_18914_test.rb +0 -43
  157. data/test/acceptance/bug_21465_test.rb +0 -34
  158. data/test/acceptance/bug_21563_test.rb +0 -25
  159. data/test/acceptance/exception_rescue_test.rb +0 -55
  160. data/test/acceptance/expectations_on_multiple_methods_test.rb +0 -55
  161. data/test/acceptance/expected_invocation_count_test.rb +0 -232
  162. data/test/acceptance/failure_messages_test.rb +0 -64
  163. data/test/acceptance/issue_65_test.rb +0 -63
  164. data/test/acceptance/issue_70_test.rb +0 -55
  165. data/test/acceptance/minitest_test.rb +0 -162
  166. data/test/acceptance/mocha_example_test.rb +0 -98
  167. data/test/acceptance/mocha_test_result_test.rb +0 -84
  168. data/test/acceptance/mock_test.rb +0 -100
  169. data/test/acceptance/mock_with_initializer_block_test.rb +0 -51
  170. data/test/acceptance/mocked_methods_dispatch_test.rb +0 -78
  171. data/test/acceptance/multiple_expectations_failure_message_test.rb +0 -68
  172. data/test/acceptance/optional_parameters_test.rb +0 -70
  173. data/test/acceptance/parameter_matcher_test.rb +0 -300
  174. data/test/acceptance/partial_mocks_test.rb +0 -47
  175. data/test/acceptance/raise_exception_test.rb +0 -39
  176. data/test/acceptance/return_value_test.rb +0 -52
  177. data/test/acceptance/sequence_test.rb +0 -192
  178. data/test/acceptance/states_test.rb +0 -70
  179. data/test/acceptance/stub_any_instance_method_test.rb +0 -198
  180. data/test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb +0 -106
  181. data/test/acceptance/stub_class_method_defined_on_class_test.rb +0 -72
  182. data/test/acceptance/stub_class_method_defined_on_module_test.rb +0 -75
  183. data/test/acceptance/stub_class_method_defined_on_superclass_test.rb +0 -75
  184. data/test/acceptance/stub_everything_test.rb +0 -56
  185. data/test/acceptance/stub_instance_method_defined_on_active_record_association_proxy_test.rb +0 -93
  186. data/test/acceptance/stub_instance_method_defined_on_class_and_aliased_test.rb +0 -69
  187. data/test/acceptance/stub_instance_method_defined_on_class_test.rb +0 -66
  188. data/test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb +0 -75
  189. data/test/acceptance/stub_instance_method_defined_on_module_test.rb +0 -75
  190. data/test/acceptance/stub_instance_method_defined_on_object_class_test.rb +0 -75
  191. data/test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb +0 -70
  192. data/test/acceptance/stub_instance_method_defined_on_superclass_test.rb +0 -72
  193. data/test/acceptance/stub_module_method_test.rb +0 -163
  194. data/test/acceptance/stub_test.rb +0 -52
  195. data/test/acceptance/stubba_example_test.rb +0 -102
  196. data/test/acceptance/stubba_test.rb +0 -15
  197. data/test/acceptance/stubba_test_result_test.rb +0 -66
  198. data/test/acceptance/stubbing_error_backtrace_test.rb +0 -64
  199. data/test/acceptance/stubbing_method_unnecessarily_test.rb +0 -65
  200. data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +0 -130
  201. data/test/acceptance/stubbing_non_existent_class_method_test.rb +0 -157
  202. data/test/acceptance/stubbing_non_existent_instance_method_test.rb +0 -147
  203. data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +0 -130
  204. data/test/acceptance/stubbing_non_public_class_method_test.rb +0 -163
  205. data/test/acceptance/stubbing_non_public_instance_method_test.rb +0 -143
  206. data/test/acceptance/stubbing_on_non_mock_object_test.rb +0 -64
  207. data/test/acceptance/throw_test.rb +0 -45
  208. data/test/acceptance/unstubbing_test.rb +0 -151
  209. data/test/deprecation_disabler.rb +0 -15
  210. data/test/execution_point.rb +0 -36
  211. data/test/method_definer.rb +0 -24
  212. data/test/mini_test_result.rb +0 -83
  213. data/test/simple_counter.rb +0 -13
  214. data/test/test_helper.rb +0 -11
  215. data/test/test_runner.rb +0 -50
  216. data/test/unit/any_instance_method_test.rb +0 -136
  217. data/test/unit/array_inspect_test.rb +0 -16
  218. data/test/unit/backtrace_filter_test.rb +0 -19
  219. data/test/unit/cardinality_test.rb +0 -56
  220. data/test/unit/central_test.rb +0 -100
  221. data/test/unit/change_state_side_effect_test.rb +0 -41
  222. data/test/unit/class_method_test.rb +0 -260
  223. data/test/unit/configuration_test.rb +0 -38
  224. data/test/unit/date_time_inspect_test.rb +0 -21
  225. data/test/unit/exception_raiser_test.rb +0 -42
  226. data/test/unit/expectation_list_test.rb +0 -71
  227. data/test/unit/expectation_test.rb +0 -480
  228. data/test/unit/hash_inspect_test.rb +0 -16
  229. data/test/unit/in_state_ordering_constraint_test.rb +0 -43
  230. data/test/unit/method_matcher_test.rb +0 -23
  231. data/test/unit/mock_test.rb +0 -312
  232. data/test/unit/mockery_test.rb +0 -150
  233. data/test/unit/multiple_yields_test.rb +0 -18
  234. data/test/unit/no_yields_test.rb +0 -18
  235. data/test/unit/object_inspect_test.rb +0 -38
  236. data/test/unit/object_test.rb +0 -87
  237. data/test/unit/parameter_matchers/all_of_test.rb +0 -26
  238. data/test/unit/parameter_matchers/any_of_test.rb +0 -26
  239. data/test/unit/parameter_matchers/anything_test.rb +0 -21
  240. data/test/unit/parameter_matchers/equals_test.rb +0 -25
  241. data/test/unit/parameter_matchers/has_entries_test.rb +0 -51
  242. data/test/unit/parameter_matchers/has_entry_test.rb +0 -96
  243. data/test/unit/parameter_matchers/has_key_test.rb +0 -55
  244. data/test/unit/parameter_matchers/has_value_test.rb +0 -57
  245. data/test/unit/parameter_matchers/includes_test.rb +0 -44
  246. data/test/unit/parameter_matchers/instance_of_test.rb +0 -25
  247. data/test/unit/parameter_matchers/is_a_test.rb +0 -25
  248. data/test/unit/parameter_matchers/kind_of_test.rb +0 -25
  249. data/test/unit/parameter_matchers/not_test.rb +0 -26
  250. data/test/unit/parameter_matchers/regexp_matches_test.rb +0 -46
  251. data/test/unit/parameter_matchers/responds_with_test.rb +0 -25
  252. data/test/unit/parameter_matchers/stub_matcher.rb +0 -27
  253. data/test/unit/parameter_matchers/yaml_equivalent_test.rb +0 -25
  254. data/test/unit/parameters_matcher_test.rb +0 -121
  255. data/test/unit/return_values_test.rb +0 -63
  256. data/test/unit/sequence_test.rb +0 -104
  257. data/test/unit/single_return_value_test.rb +0 -14
  258. data/test/unit/single_yield_test.rb +0 -18
  259. data/test/unit/state_machine_test.rb +0 -98
  260. data/test/unit/string_inspect_test.rb +0 -11
  261. data/test/unit/thrower_test.rb +0 -20
  262. data/test/unit/yield_parameters_test.rb +0 -93
@@ -1,11 +1,412 @@
1
- = 0.10.5 (a5a64cf9755b21d4a30e446232654d1c0fc6f151)
1
+ # Release Notes
2
+
3
+ ## 1.13.0
4
+
5
+ ### External changes
6
+
7
+ * Add `ParameterMatchers#has_keys` - thanks to @cstyles for #512 (18d8104)
8
+ * Fix misleading exception message in `ParameterMatchers#has_entry` - thanks to @cstyles for #513 (9c4ef13)
9
+ * Only add dependency on rubocop if we're actually going to use it (f2f879f)
10
+ * Fix rake dependency constraints for older Ruby versions (7ce5f29)
11
+
12
+ ### Internal changes
13
+
14
+ * Check documentation can be generated as part of CircleCI build (b30d9a9)
15
+ * Add --fail-on-warning option to yard rake task (53a6ee3)
16
+ * Add a weekly scheduled build to the CircleCI build (fd2a4c6)
17
+ * Add Ruby v1.8 to the CircleCI build matrix (818ca03)
18
+ * Add API token to fix CircleCI badge in README (607c5aa)
19
+ * Provide wrapped option for #mocha_inspect on hashes & arrays (d8f44bc)
20
+ * Use CircleCI instead of TravisCI for automated builds (c98c6ec)
21
+ * Switch to newer default Travis CI build env (c78f75c)
22
+ * Use latest Ruby versions in Travis CI builds (9e0043a)
23
+ * Use latest JRuby v9.2.18 in Travis CI builds (8c99a1b)
24
+ * Use consistent JRuby versions in Travis CI builds (0f849aa)
25
+ * Use more recent version of JRuby in Travis CI build matrix (58653db)
26
+
27
+ ## 1.12.0
28
+
29
+ ### External changes
30
+
31
+ * Various improvements to README inspired by #207 and #390 - thanks to @nitishr for his work on #390 (fed0eee6)
32
+ * Improve documentation related to `StateMachine` classes - thanks to @nitishr (#425 & #427)
33
+ * Fix regression in cardinality introduced in v1.10.0 (59454a8) and reported in #473 - thanks to @srvance for reporting and @nitishr for fixing (#474)
34
+ * Fix documentation for `Mocha::Expectation#when` - thanks to @olleolleolle (b4f59daa & #477)
35
+ * Remove `Mocha::Mock#respond_to?` from documentation - thanks to @nitishr (#480)
36
+ * Improvements to documentation for `Expectation#yields` & `#multiple_yields` - thanks to @andyw8 for reporting in #495 (1b6571c)
37
+ * Remove documentation & tests from gem to reduce its size by over 50% - thanks to @gabetax (#500)
38
+ * Update documentation to point to travis-ci.com instead of travis-ci.org
39
+
40
+ ### Internal changes
41
+
42
+ * Refactor `StateMachine`-related classes - thanks to @nitishr (#425 & #427)
43
+ * Remove redundant test - thanks to @nitishr (8e4f1a7c)
44
+ * Add Ruby 2.7 to Travis CI matrix - thanks to @bastelfreak (fc5ea2f2)
45
+ * Simplify `Mockery` - thanks to @nitishr (#449)
46
+ * Update Travis CI badge to point to main vs master branch (bd8028f8)
47
+ * Generate docs using newer version of yard (v0.9.25) (c619afac)
48
+ * Manually upgrade jquery in docs from v1.7.1 -> v1.9.0 to fix CVE-2017-16011 (211098a5, dd5eeedb & 1b76e4d5; also see #492)
49
+ * Remove reference to non-existent jquery source map to fix error in Chrome developer tools (20156555)
50
+ * Temporarily ignore Ruby v1.8.7 build failures (e5b9feef)
51
+
52
+ ## 1.11.2
53
+
54
+ ### External changes
55
+
56
+ * Fix regression introduced in v1.10.0 that meant `Object#inspect` was called unnecessarily (368abd98)
57
+ * Warn when mock object receives invocations in another test - thanks to @nitishr (#442)
58
+ * Avoid rubocop comments appearing in YARD-generated docs (d8019eed)
59
+
60
+ ### Internal changes
61
+
62
+ * Replace `StubbedMethod#original_method` & `#original_visibility` attribute reader methods with instance variables - thanks to @nitishr (d917f332)
63
+ * Set up `MochaExampleTest` & `StubbaExampleTest` as acceptance tests - thanks to @nitishr (4881cc58)
64
+ * Delete unused `PrettyParameters` class - thanks to @nitishr (314ea922)
65
+
66
+ ## 1.11.1
67
+
68
+ ### External changes
69
+
70
+ * The `reinstate_undocumented_behaviour_from_v1_9` 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)
71
+
72
+ ## 1.11.0
73
+
74
+ ### External changes
75
+
76
+ * Add `Expectation#with_block_given` & `Expectation#with_no_block_given` (#441).
77
+ * Allows non-deprecated solution for #382. Thanks to @yemartin for reporting and to @techbelly & @nitishr for feedback.
78
+ * Fix issue with non-Array arguments passed to `Expectation#multiple_yields` (#444).
79
+ * The undocumented behaviour is now properly supported and documented.
80
+
81
+ ### Internal changes
82
+
83
+ * Move static YARD options from Rake task to `.yardopts` file - thanks to @nitishr (#429)
84
+ * Simplify implementation of yielding functionality - thanks to @nitishr (#439)
85
+ * Add missing require statement to `acceptance_test_helper.rb` (1070fc02)
86
+ * Add some baseline acceptance tests for yielding behaviour (c2cac911)
87
+ * Display a sponsor button on GitHub repo page (9fc5911b)
88
+ * Use new Deprecation.warning behaviour in `Invocation#call` (932d1166)
89
+
90
+ ## 1.10.2
91
+
92
+ * Optionally reinstate undocumented behaviour from v1.9. This introduces a new configuration option (`reinstate_undocumented_behaviour_from_v1_9`) to reinstate a couple of bits of undocumented behaviour from v1.9 which were changed in v1.10 without any prior deprecation warning (#438):
93
+ * The behaviour of `API#mock`, `API#stub` and `API#stub_everything` when called with a symbol as the first argument.
94
+ * The behaviour of `Expectation#yields` and `Expectation#multiple_yields` when the stubbed method is called without a block.
95
+
96
+ ## 1.10.1
97
+
98
+ * Ensure ObjectMethods & ClassMethods included when API extended (43778756)
99
+ * Fix regression in `any_instance` stubbing of methods on object which has an implementation of `#respond_to?` that depends on the object's internal state - thanks to @rafaelfranca for reporting & @nitishr for fixing (#432, #434, 469d4b17)
100
+
101
+ ## 1.10.0
102
+
103
+ * Improve deprecation warning when requiring 'mocha/setup' (388f44d7)
104
+ * Add documentation for Cucumber integration (13ab797b)
105
+ * Add documentation about an undocumented feature of `API#mock`, `API#stub` & `API#stub_everything` being changed (7ed2e4e7, d30c1717)
106
+
107
+ ## 1.10.0.beta.1
108
+
109
+ * Hide `ClassMethods#method_visibility` & `#method_exists?` methods to avoid clash with Rails (#428)
110
+
111
+ ## 1.10.0.alpha
112
+
113
+ ### External changes
114
+
115
+ * Remove dependency on metaclass gem (#49, #365)
116
+ * Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377)
117
+ * More realistic examples in documentation for `Expectation#yields` and `#multiple_yields` - thanks to @nitishr (#352, #383)
118
+ * Improve documentation for `Mock#responds_like` & `#responds_like_instance_of` - thanks to @nitishr (#337, #384)
119
+ * Make `Expectation#yields` & `Expectation#multiple_yields` 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's behaviour. If this causes your tests to fail, then fix it by removing the unnecessary call to `Expectation#yields` or `Expectation#multiple_yields` - thanks to @nitishr (#382)
120
+ * Document `MOCHA_OPTIONS` in README - thanks to @nitishr (#311, #386)
121
+ * Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385)
122
+ * Deprecation warning if integration using 'mocha/test_unit' or 'mocha/minitest' fails - thanks to @nitishr (#229, #389, c6032d0b)
123
+ * Require at least one specified sequence for `Expectation#in_sequence` - thanks to @nitishr (#79, #396, 9020248a)
124
+ * Make signatures of `Mock#unstub` & `ObjectMethods#unstub` consistent - thanks to @nitishr (#397, f04d437)
125
+ * Deprecate requiring 'mocha/setup' (36adf880)
126
+ * Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410)
127
+ * Put deprecations into effect (#400, #418):
128
+ * Remove deprecated 'mocha_standalone.rb' & 'mocha/standalone.rb'
129
+ * Fail fast if no test library loaded
130
+ * Removed optional block for `Mocha::API#mock`, `#stub` & `#stub_everything`
131
+ * Remove deprecated `ParameterMatchers#has_equivalent_query_string` method
132
+ * Remove deprecated 'mocha/mini_test.rb'
133
+ * Fix typo in docs for `Mocha::Configuration.prevent` (266ce71c)
134
+ * New-style configuration (see documentation for `Mocha::Configuration`) (#407, #421)
135
+ * Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d)
136
+ * Deprecate support for versions of test-unit & minitest which need monkey-patching (a34e1a88)
137
+ * Deprecate old-style Rails plugin (#403, 2df77134)
138
+ * Documentation fixes & improvements which also fix YARD warnings (472d5416, a2c0d64a)
139
+
140
+ ### Internal changes
141
+
142
+ * Pin minitest to v5.11.3 for Ruby v1.8.7 to fix build; minitest no longer supports Ruby v1.8.7 (4a0a580)
143
+ * Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f)
144
+ * Only run rubocop for MRI Ruby versions & non-integration test builds (8f1c6af)
145
+ * Reduce duplication in any instance method class - thanks to @nitishr (#378)
146
+ * Simplify `AnyInstanceMethod`, `ClassMethod`, `InstanceMethod`, `ModuleMethod` class hierarchy - thanks to @nitishr (#381)
147
+ * Simplify `ClassMethods#method_exists?` & `ObjectMethods#method_exists?` making them consistent - thanks to @nitishr (#270, #362, #370)
148
+ * Don't override definition of `singleton_class` in `ClassMethods` - thanks to @nitishr (#391, #392)
149
+ * Do not include 'method_definer' methods into all objects (#268, #402)
150
+ * Distinguish different `ObjectMethods` modules (#268, #404)
151
+ * Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411)
152
+ * Consistently use `assert_raises` - thanks to @nitishr (#405, #412, a66b7bed)
153
+ * Update Ruby & JRuby versions in Travis CI config (18cb1a93, eb061c53)
154
+ * Rubocop improvements (aa16ea67...6f4db70b, 2a1240e6...e95716ae)
155
+ * Fix inconsistency in CardinalityTest (aa10e0a8)
156
+ * Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535)
157
+ * Remove default argument in `Expectation#invoke` - thanks to @nitishr (#414, #420)
158
+
159
+ ## 1.9.0
160
+
161
+ * Add TruffleRuby to Travis CI build matrix - thanks to @deepj (#354)
162
+ * Explicitly set Travis CI OS to Ubuntu Trusty 14.04 (ded1fa45)
163
+ * Expand explanation of thread-safety concerns - thanks to @techbelly (#357)
164
+ * Refactor class method and any instance method - thanks to @chrisroos (#358)
165
+ * Rely on default bundler version in Travis CI builds (3352e9c5)
166
+ * Fix local build-matrix script (11abe231)
167
+ * No need to install latest bundler in build-matrix script (8247a894)
168
+
169
+ ## 1.8.0
170
+
171
+ * Constrain rubocop version to avoid breaking Travis CI builds (05e507f5)
172
+ * Avoid calling Kernel#format from ObjectMethods#mocha_inspect - thanks to @hoffmanilya (#345)
173
+ * Fix build matrix script (#346)
174
+ * Avoid deprecation warning in gemspec (4976e0bc)
175
+ * Removed link to documentation translation (ef428ea2)
176
+ * Don't use the new bundler v2 in builds (683ded9b)
177
+ * Moved documentation from https://gofreerange.com/mocha/docs to https://mocha.jamesmead.org/ [683ded...a17fde](https://github.com/freerange/mocha/compare/683ded...a17fde)
178
+
179
+ ## 1.7.0
180
+
181
+ * Update Ruby & JRuby versions in Travis CI config (9bf55631 & 3883af7e)
182
+ * Simplify gemspec (63744f86)
183
+ * Add rubocop and fix most cop violations (#341)
184
+ * Use Kernel#warn for deprecations - thanks to @etiennebarrie (#333, 196970a)
185
+
186
+ ## 1.6.0
187
+
188
+ * Fix subtle bug in setting correct visibility of stubbed module methods on `Kernel` or `Object` - thanks to @chrisroos (#295)
189
+ * Avoid mocks for partial mocking leaking into subsequent tests - thanks to @skliew for reporting (#331)
190
+ * Remove OpenCollective badge, backers & sponsors (a283a079)
191
+ * Change gem version badge to SVG format and add SemVer stability badge - thanks to @greysteil (#335)
192
+ * Improve documentation for Configuration (#236)
193
+
194
+ ## 1.5.0
195
+
196
+ * Prevent use of Mocha outside the context of a test/example - thanks to @andyw8 & @lzap (#327)
197
+
198
+ ## 1.4.0
199
+
200
+ * Fix deprecation warning for `assert_nil` in `ClassMethodTest` (#308 & #309)
201
+ * Display file and line number in deprecation warning - thanks to @chrisarcand (#310, #312 & #313)
202
+ * Rename `mocha/mini_test.rb` to `mocha/minitest.rb` - thanks to @grosser (#320 & #322)
203
+ * Fix warning when delegating to mock in Ruby 2.4 - thanks to @tjvc (#321 & #323)
204
+ * Updates to Travis CI configuration ([73af600..9732726](https://github.com/freerange/mocha/compare/73af600...9732726) & 0426e5e)
205
+
206
+ ## 1.3.0
207
+
208
+ * Ensure all tests run individually - thanks to @chrisroos (#267)
209
+ * Update Travis CI build status badge to show master branch status (#264)
210
+ * Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)
211
+ * Fix pretty printing of quotes in `String#mocha_inspect` (#215 & #223)
212
+ * Add release instructions to README - thanks to @chrisroos (70a5febd & 3c664df7)
213
+ * Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)
214
+ * Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos (8f58eddf)
215
+ * Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 & eca7560c)
216
+ * Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)
217
+ * Add latest stable version of JRuby to Travis CI build matrix (#288)
218
+ * Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)
219
+ * Deprecate passing block to mock object constructor (#290)
220
+ * Add a known issue to README for Ruby bug 12876 (#276)
221
+ * Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga (#297)
222
+ * Fix `Mocha::ParameterMatchers#includes` for `Array` values - thanks to @timcraft (#302)
223
+ * Use faster container-based virtual environments for Travis CI builds (#305)
224
+ * Rename `Mocha::ParameterMatchers::QueryStringMatches` to `QueryString` (#306)
225
+ * Handle blank parameter value for query string matcher - thanks to @weynsee (#303 & #304)
226
+ * Rename `Mocha::ParameterMatchers::QueryString` -> `EquivalentUri` (#307)
227
+ * Use `do ... end` instead of `{ ... }` in acceptance tests - thanks to @chrisroos (#294)
228
+
229
+ ## 1.2.1
230
+
231
+ * Fixed #272. Workaround Ruby bug 12832 which caused interpreter to hang. See https://bugs.ruby-lang.org/issues/12832. Thanks to @chrisroos & @petems (6f1c8b9b, #273).
232
+
233
+ ## 1.2.0
234
+
235
+ * Always use prepended module to stub class & instance methods for Ruby v2+ - thanks to @grosser & @chrisroos (43d56671, #244)
236
+ * Always use prepended module to stub AnyInstance methods in Ruby v2+ - thanks to @chrisroos (#262)
237
+ * Always set visibility of stub method to match stubbed method on included module - thanks to @grosser & @chrisroos (e87c03b0, #248)
238
+ * Always set visibility to stub method to match stubbed method on superclass - thanks to @chrisroos (38d902ad)
239
+ * Allow stubbing of method to which any instance responds (#200)
240
+ * Allow `includes` matcher to take matcher arguments - thanks to @lazyatom (#217)
241
+ * Avoid exception in older version of Rubygems - thanks to @chrisroos (78d930a7)
242
+ * Add licenses to gemspec as requested by @coreyhaines (#201)
243
+ * Fix typo in README - thanks to @jaredbeck (6119460d)
244
+ * Added section about using Mocha with RSpec & Rails to README (#221)
245
+ * Fix documentation for Mocha::API#stub method - thanks to @raeno (599b1dcd)
246
+ * Added backers and sponsors from OpenCollective - thanks to @piamancini (#253)
247
+ * Fix typo in docs for equals - thanks to @alexcoco (#254)
248
+ * Add known issue for Ruby v1.8 to README - thanks to @chrisroos (2c642096)
249
+
250
+ ## 1.1.0
251
+
252
+ * Set visibility of any instance stub method.
253
+ * Stub methods with a prepended method if there are other prepended methods. Thanks to @mrsimo.
254
+ * Improve docs for `Mock#responds_like` & `#responds_like_instance_of`.
255
+ * Use GitHub convention for instructions on contributing to Mocha.
256
+ * Fix typos in docs. Thanks to @10io
257
+
258
+ ## 1.0.0
259
+
260
+ ### External changes
261
+ * Assume 'mocha' has been required when requiring 'mocha/setup'.
262
+ * Provide shortcuts for integrating with specific test library i.e. `require 'mocha/test_unit'` or `require 'mocha/mini_test'`
263
+ as alternatives to `require 'mocha/setup'`.
264
+ * Do not automatically try to integrate with test libraries. Since the automatic test library integration functionality
265
+ requires the test library to be loaded and this doesn't usually happen until *after* the bundle is loaded, it makes things
266
+ simpler if we use `require 'mocha/setup'` to explicitly setup Mocha when we know the test library has been loaded. Fixes #146 & #155.
267
+ * Consider stubs on superclasses if none exist on primary receiver. Largely based on changes suggested by @ccutrer in #145.
268
+ Note: this may break existing tests which rely on the old behaviour. Stubbing a superclass method and then invoking that
269
+ method on a child class would previously cause an unexpected invocation error. By searching up through the inheritance
270
+ hierarchy for each of the delegate mock objects, we can provide more intuitive behaviour. Instead of an unexpected invocation
271
+ error, invoking the method on the child class will cause the stubbed method on the superclass to be used.
272
+ * Avoid recursion when constructing unexpected invocation message. Fixes #168.
273
+ * Add explanation of method dispatch. Heavily based on the relevant jMock v1 documentation. Fixes #172.
274
+ * Make class_eval line number more accurate. This sets the line number as the line number of the `def` statement. Closes #169.
275
+ * Allow nesting of `responds_with` parameter matcher. Closes #166.
276
+ * Define `Mocha` module before it's referenced. The test helper defines a class `TestCase` within the `Mocha` module. When
277
+ running the tests inside the bundle, the `Mocha` 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: `uninitialized constant Mocha (NameError)`. Fixes #163.
278
+ * Document lack of thread-safety. Fixes #154.
279
+ * Document how to use the build-matrix script. Fixes #160.
280
+ * Stubbing non-public method should use same visibility. This will probably break some existing tests that were somehow relying
281
+ on the stubbed method being public while the original method was protected or private. Fixes #150.
282
+
283
+ ### Internal changes
284
+ * Use lastest Rubygems in Travis CI builds.
285
+ * Run the standard test suite against Ruby 2.1.0 in the build matrix.
286
+ * Run integration tests against Ruby 2.0.0 with latest Test::Unit gem in the build matrix.
287
+ * Test::Unit is not available in Ruby v1.9.3 standard library, so remove it from the build matrix.
288
+ * Force use of Test::Unit runner, etc in relevant integration tests. Prior to this, I don't think we were really testing the
289
+ Mocha integration with Test::Unit much, because, although `TestUnitTest` was a subclass of `Test::Unit::TestCase`, the
290
+ important test case instances are the temporary ones built by `TestRunner#run_as_test` et al. Prior to this change, these
291
+ would only have used Test::Unit where MiniTest was not available *at all* i.e. only in early versions of Ruby and when the
292
+ MiniTest gem was not loaded.
293
+ * Reset environment variables between build matrix builds.
294
+ * Only activate integration with relevant test library for each of the integration tests.
295
+ * Include standard build combinations from Travis CI config i.e. builds using standard library versions of test libraries.
296
+ * Fix `build-matrix.rb` script. Also use `.travis.yml` to decide what combinations to run. This means we
297
+ can now simulate the Travis CI build locally and avoid duplication. Fixes #157.
298
+ * Remove Ruby version map from build matrix script. I'm using the `rbenv-aliases` plugin to alias minor versions to the
299
+ relevant patch version.
300
+
301
+ ## 0.14.0
302
+
303
+ * Official support for MiniTest v5. All tests now pass on the continuous integration build.
304
+
305
+ ## 0.14.0.alpha
306
+
307
+ * 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.
308
+ * Documentation updates.
309
+
310
+ ## 0.13.3
311
+ * Allow `Mocha::ParameterMatchers#includes` to accept multiple items. Thanks to @simao.
312
+ * Allow stubbing of *private* `Kernel` methods. Fixes #134. Thanks to @camski for reporting.
313
+ * Avoid a warning when `test/unit/version` is required by other libraries in the same project. Fixes #140. Thanks to @tmiller.
314
+ * 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 `minitest-spec-rails` gem. Fixes #143. Thanks to @tubaxenor for reporting.
315
+ * Safer restoration of stubbed method visibility. Fixes #141. Thanks to @tmm1.
316
+ * Ensure `Mockery` instance gets reset even if exception raised. Fixes #144.
317
+ * Adapt Mocha acceptance tests to cope with changes in output from latest (v4.6.2) of MiniTest.
318
+ * Updates to README about Rails compatibility.
319
+
320
+ ## 0.13.2
321
+ * Stubbing of methods re-declared with different visibilty. Fixes #109.
322
+ * Add `Mock#responds_like_instance_of`. Fixes #119.
323
+ * Make `Expectation#inspect` less verbose and more useful. Fixes #122.
324
+ * Make unit tests more robust to changes in environment. Fixes #121.
325
+ * Update README in an attempt to head Rails-related issues off at the pass.
326
+ * Add a Gem Badge to provide a link to Mocha on Rubygems.
327
+ * Make documentation example consistent with other examples.
328
+
329
+ ## 0.13.1
330
+ * Fix #97 - `Mocha::ParameterMatchers#has_entry` does not work with an Array as the entry's value. Thanks to @ngokli.
331
+ * Allow deprecation `:debug` mode to be switched on from `MOCHA_OPTIONS` environment variable.
332
+
333
+ ## 0.13.0
334
+ * Major overhaul of MiniTest & 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 & @kou for their help, suggestions & patience.
335
+ * Temporarily deprecated `require 'mocha'`. Use `require 'mocha/setup'` instead. The plan is that eventually `require 'mocha'` will *not* automatically integrate with either of the two test libraries as it does at the moment, and you'll need to explicitly & separately trigger the integration. I think this will provide a lot more flexibility and will hopefully do away with the need for the `require: false` option in the `Gemfile` which has always confused people.
336
+ * Deprecated `require 'mocha_standalone'` and `require 'mocha/standalone'`. Use `require 'mocha/api` instead.
337
+ * Although these are not part of Mocha's public API, I thought I should mention that the MiniTest and Test::Unit assertion counter classes have been combined into a single class `Mocha::Integration::AssertionCounter`.
338
+ * Extracted Mocha::Hooks module from Mocha::API and added documentation for test library authors.
339
+ * Improvements to documentation. Much of it has been combined into the README file.
340
+ * Fix #101 - Mock#respond_to? doesn't work with a string argument - thanks to @urbanautomaton.
341
+ * Fix #105 - Travis link in README - thanks to @cknadler.
342
+ * Various improvements to automated testing of integration with test libraries.
343
+ * Make deprecation warnings more prominent.
344
+
345
+ ## 0.12.7
346
+ * Officially support minitest v4.1.0 (still monkey-patching).
347
+
348
+ ## 0.12.6
349
+ * Fixes #103.
350
+
351
+ ## 0.12.5
352
+ * Officially support minitest v3.5.0 (still monkey-patching).
353
+
354
+ ## 0.12.4
355
+ * Officially support minitest v3.4.0 & test-unit v2.5.2 (still monkey-patching).
356
+
357
+ ## 0.12.3
358
+ * Revert rename of undocumented internal module since it turns out Rails/ActiveSupport is relying on its existence.
359
+
360
+ ## 0.12.2
361
+ * Officially support minitest v3.3.0 (still monkey-patching)
362
+
363
+ ## 0.12.1
364
+ * Deprecation warning (instead of fail fast) if neither Test::Unit nor MiniTest is loaded. Fixes #88.
365
+ * Remove deprecated access to `Mocha::Standalone`.
366
+ * Remove the deprecated file `stubba.rb`.
367
+ * Officially support test-unit v2.5.1 (still monkey-patching).
368
+ * Improve the API acceptance test.
369
+
370
+ ## 0.12.0
371
+ * Fail fast if neither Test::Unit nor MiniTest is loaded. Fixes #40.
372
+ * Officially support MiniTest up to v3.2.0 (still monkey-patching).
373
+ * Officially support test-unit v2.5.0 (still monkey-patching).
374
+ * Do not monkey-patch Test::Unit or MiniTest unless we *know* it's ok.
375
+ * Add acceptance tests to demonstrate using a block as a custom parameter matcher.
376
+ * Update Travis CI build status image to use the new build under the freerange account.
377
+
378
+ ## 0.11.4
379
+ * Homepage has moved to http://gofreerange.com/mocha/docs.
380
+
381
+ ## 0.11.3
382
+ * Fix for #78 i.e. alias Object#method as Object#_method, not Object#__method__ which already exists as another Ruby method.
383
+
384
+ ## 0.11.2
385
+ * 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 https://github.com/rails/rails/pull/5907 for further info.
386
+
387
+ ## 0.11.1
388
+ * In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76.
389
+
390
+ ## 0.11.0
391
+ * 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.
392
+ * Attempting to stub a method on a frozen object should fail fast. See #68.
393
+ * Prevent stubbing a method on nil by default. See #68.
394
+ * Generate documentation using YARD instead of Rdoc - removes dependency on Coderay.
395
+ * Publish documentation on Github pages instead of Rubyforge - uses rake task written by @tomafro.
396
+ * Remove agiledox which has outlived it's usefulness.
397
+ * Removed trailing whitespace throughout codebase.
398
+ * Add documentation for Mock#unstub.
399
+ * Improve documentation for ObjectMethods.
400
+ * Provide a way to run multiple tests within a single acceptance test method.
401
+
402
+ ## 0.10.5
2
403
  * 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.
3
404
  * 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.
4
405
  * Add links to README for source code & issue tracker.
5
406
  * Fix for issue #67 - Make the travis-ci badge visible in the README. Thanks to Diego Plentz for pull request.
6
407
  * Fix for issue #70 - Rename Mock#expectations to Mock#__expectations__ to avoid conflicts. Thanks to Jeremy Stephens for pull request.
7
408
 
8
- = 0.10.4 (babdd656c361ac65f25948104adf612e59174a5e)
409
+ ## 0.10.4
9
410
  * Fix for issue #65 - expectations not being verified in subsequent tests.
10
411
  * Fix for issue #63 - require Mocha::Mockery at Mocha::Mock class load time and not on invocation of Mock#method_missing.
11
412
  * Fix for issue #45 - raise ArgumentError if Mocha::ParameterMatchers#has_entry is given
@@ -13,13 +414,13 @@ Hash with wrong number of entries.
13
414
  * Make global variable name more obscure to avoid clashes with other libraries.
14
415
  * Move travis-ci-related gemfiles into their own directory.
15
416
 
16
- = 0.10.3 (e7f88af8e7c3396bc85fe9f9cb9e5f5fef04bea2)
417
+ ## 0.10.3
17
418
  * 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's much safer to use that. Thanks to fguillen for reporting and helping with diagnosis.
18
419
 
19
- = 0.10.2 (e05d9a555f1cf97c5961900dab0d884e9753257b)
420
+ ## 0.10.2
20
421
  * Merge pull request #53. Unstubbing a method should not remove expectations for other stubbed methods. Fixes #52. Thanks to saikat.
21
422
 
22
- = 0.10.1 (f631a4ba22c6ed4929c52b0520311a9a84034a20)
423
+ ## 0.10.1
23
424
  * Merge pull request #51. Use Gem::Requirement & Gem::Version for version comparison. Fixes issue #50. Thanks to meineerde.
24
425
  * Fixed typo in rdoc for Mocha::ObjectMethods.
25
426
  * Improve README as suggested in issue #46. Explain that Mocha must be loaded after test libraries and how to achieve this using Bundler.
@@ -29,7 +430,7 @@ Hash with wrong number of entries.
29
430
  * Support for MiniTest up to v2.6.2 has been verified.
30
431
  * Add explicit development dependency on coderay for generating syntax-highlighted code examples.
31
432
 
32
- = 0.10.0 (68a4a59e1af74baf3929af418f73f5627bba548d)
433
+ ## 0.10.0
33
434
  * Add Expectation#throws to allow a stubbed method to use Kernel#throw.
34
435
  * Updates for versions of Test::Unit up to and including v2.3.3 (including patch by Jens Fahnenbruck).
35
436
  * Updates for versions of MiniTest up to and including v2.5.1.
@@ -48,13 +449,13 @@ Hash with wrong number of entries.
48
449
  * Remove the `use_test_unit_gem` MOCHA_OPTION which hasn't worked since we switched to bundler - we can now run the tests specifying a different Gemfile instead.
49
450
  * Use multiple Gemfiles seems to run Travis CI builds against multiple version of test-unit & minitest.
50
451
 
51
- = 0.9.12 (8bb523e8467626c23b271eb529c33fb118e368fe)
452
+ ## 0.9.12
52
453
  * Make Mocha'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.
53
454
  * Avoid 'circular require considered harmful' warning when running Mocha's tests in Ruby 1.9.2
54
455
  * Make performance tests work on Ruby 1.9.2 i.e. using MiniTest.
55
456
  * Declare rake as a *development* dependency with newer versions of Rubygems since it's only needed to carry out developer-related tasks.
56
457
 
57
- = 0.9.11 (1613ed2267fef5927ea06adfdbcf512b89eadaad)
458
+ ## 0.9.11
58
459
  * Added explicit support for minitest v1.5.0 to v2.0.2.
59
460
  * Make testable by rubygems-test.
60
461
  * Update links to my blog and make other links consistent.
@@ -62,13 +463,13 @@ Hash with wrong number of entries.
62
463
  * Include unexpected invocation in failure message and change the language slightly to make the failure message less confusing. See http://floehopper.lighthouseapp.com/projects/22289/tickets/52.
63
464
  * No need to create regular expression every time the BacktraceFilter#filtered method is called. See http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/66.
64
465
 
65
- = 0.9.10 (31182ea8b38b79aa50702aa839f6a29ebcf7d684)
466
+ ## 0.9.10
66
467
  * Added Mocha::ObjectMethods#unstub method - https://github.com/floehopper/mocha/issues#issue/6
67
468
  * Inherit Mocha::ExpectationError from Exception instead of StandardError to reduce the chances of a test passing by accident - thanks to James Sanders (jsanders) - https://github.com/floehopper/mocha/issues#issue/15
68
469
  * Fixed bug - GitHub README page to link correctly to code examples - https://github.com/floehopper/mocha/issues/closed#issue/11
69
470
  * Fixed bug - PASSTHROUGH_EXCEPTIONS are defined on MiniTest::Unit::TestCase not in Mocha - thanks to Brian Troutwine (blt) - https://github.com/floehopper/mocha/issues/closed#issue/14
70
471
 
71
- = 0.9.9 (ee3a79db4d52c3339e8acf07505e01236a2b4810)
472
+ ## 0.9.9
72
473
  * 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 'load' instead of 'require' to detect the version of Test::Unit, we can avoid rubygems trying to load bits of the test-unit gem when it's not wanted. [1] http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/50#ticket-50-13
73
474
  * Fix exception when running rake without test-unit gem. When test-unit gem >=v2.0.0 was installed but the "use_test_unit_gem" MOCHA_OPTIONS was not specified, a "comparison of Fixnum with Hash failed" 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.
74
475
  * Explicitly require rubygems for running tests via rake using test-unit gem.
@@ -86,17 +487,17 @@ Hash with wrong number of entries.
86
487
  * Improved RDoc including a change suggested by Rohit Arondekar (rohit).
87
488
  * Updated gemspec as requested by Sam Woodard (shwoodard).
88
489
 
89
- = 0.9.8 (645024765b2d92018efc511652e1174163844e39)
490
+ ## 0.9.8
90
491
  * Fixed bug "NameError raised when using Mocha as a Rails plug-in" - http://floehopper.lighthouseapp.com/projects/22289/tickets/53. Since 0.9.6 the Rails plugin has been broken. See bug report for details. You will need to explicitly load Mocha *after* the test framework has been loaded, e.g. by adding "require 'mocha'" at the bottom of test/test_helper.rb.
91
492
  * Make Mocha::ParameterMatchers#regexp_matches, #includes, #has_value, #has_key more robust. Thanks to Sander Hartlage.
92
493
  * Allow passing a block to Mocha::Configuration methods to only change configuration for the duration of the block. Thanks to Dan Manges.
93
494
  * Fixed bug "doc generation fails in 0.9.7 gem" - http://floehopper.lighthouseapp.com/projects/22289/tickets/51.
94
495
  * 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.
95
496
 
96
- = 0.9.7 (80d816f250dc13aaf856f3f9cbd97ebe9c371839)
497
+ ## 0.9.7
97
498
  * Although I had provided a deprecation warning for people using Mocha::Standalone, I had assumed people wouldn'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.
98
499
 
99
- = 0.9.6 (57f8f77d715b7f1d9efee2e1a9438f7905c0006b)
500
+ ## 0.9.6
100
501
  * Version 2.0.1 of the test-unit gem introduced a private 'run_test' method on TestCase which clashed with the public TestRunner#run_test method. So this latter method has been renamed to 'run_as_test'.
101
502
  * Stop requiring rubygems - this should be an environmental choice for the user. http://gist.github.com/54177 - describes why requiring rubygems in your library code is a bad idea.
102
503
  * It seems like overkill to vendorize coderay and meta_project when they're only needed to generate the examples for documentation and for publishing files on RubyForge. So I'm removing them and installing them locally as gems when I need them.
@@ -111,30 +512,30 @@ Hash with wrong number of entries.
111
512
  * 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 - http://floehopper.lighthouseapp.com/projects/22289/tickets/49.
112
513
  * Made Mocha compatible with minitest 1.4.0 and above (thanks to Denis Defreyne).
113
514
 
114
- = 0.9.5 (93cad010345ce5d68f31422cfc32ed9dd6de13ec)
515
+ ## 0.9.5
115
516
  * Fixed Lighthouse bug #32 - stub_everything should mean mock responds to anything.
116
517
  * Added Expectation#twice to improve readability. Thanks to pull request from Celestino Gomes.
117
518
  * In Ruby 1.9.1, requiring 'test/unit' 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.
118
519
  * Ruby 1.9 includes rake, but not rake/contrib. For the moment I'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 - http://intertwingly.net/blog/2008/01/07/Rake-Contrib-for-1-9
119
520
 
120
- = 0.9.4 (8a59c6ff0f99f34b02bd99f19536a7893be2b340)
521
+ ## 0.9.4
121
522
  * Added mocha.gemspec file generated with Chad Woolley's new rake task, so that a floehopper-mocha gem will get built on GitHub.
122
523
  * Add rake task to update mocha.gemspec with unique version, which will cause gem to be auto-built on github
123
524
  * As Tobias Crawley correctly pointed out in feature request #23055 "stubs(with_hash) not working with existing object" [1], following the principle of least surprise, it should be possible to call ObjectMethods#expects & ObjectMethods#stubs with a Hash of method_names vs return_values like you can with Mock#expects & Mock#stubs. I've also updated & improved the docs to reflect the changes. [1] http://rubyforge.org/tracker/index.php?func=detail&aid=23055&group_id=1917&atid=7480
124
525
  * Removed deprecated gem autorequire.
125
526
 
126
- = 0.9.3 (8219bb2d2881c8529c93fc21e97a11d01203c759)
527
+ ## 0.9.3
127
528
  * Added support for MiniTest thanks to Jeff Smick.
128
529
  * Fixed a possible bug with some of the non-default Configuration options relating to the argument to Object#respond_to?
129
530
  * 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's behaviour is more easily extended. [1] http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html & http://blog.jayfields.com/2008/07/ruby-redefine-method-behavior.html
130
531
  * Removed deprecated gem autorequire.
131
532
 
132
- = 0.9.2 (r355)
533
+ ## 0.9.2
133
534
  * Improved documentation to address [#22530] 'Mock methods with multiple return values not possible?'
134
535
  * respond_with parameter matcher was not available in tests.
135
536
  * 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.
136
537
 
137
- = 0.9.1 (r349)
538
+ ## 0.9.1
138
539
 
139
540
  * Fixed bug #21465 - expects & 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.
140
541
  * By removing Mock#unexpected_method_called we reduce the number of methods vulnerable to the problem that surfaced in bug #21563.
@@ -147,7 +548,7 @@ Hash with wrong number of entries.
147
548
  * It's more readable to talk about 'once' and 'twice' rather than '1 time' and '2 times'.
148
549
  * 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't seem so awful.
149
550
 
150
- = 0.9.0 (r316)
551
+ ## 0.9.0
151
552
 
152
553
  * Configurable warnings or errors
153
554
  * when a method on a non-public method is stubbed
@@ -192,16 +593,16 @@ Hash with wrong number of entries.
192
593
  * 15977 in revision 198 - http://rubyforge.org/tracker/index.php?func=detail&aid=15977&group_id=1917&atid=7477
193
594
  * 11885 in revision 156 - http://rubyforge.org/tracker/index.php?func=detail&aid=11885&group_id=1917&atid=7477
194
595
 
195
- = 0.5.5 (r167)
596
+ ## 0.5.5
196
597
 
197
598
  - Renamed Matches parameter matcher to RegexpMatches for clarity.
198
599
  - Added noframes tag to rdoc index to assist Google.
199
600
 
200
- = 0.5.4 (r166)
601
+ ## 0.5.4
201
602
 
202
603
  - Added matches parameter matcher for matching regular expressions.
203
604
 
204
- = 0.5.3 (r165)
605
+ ## 0.5.3
205
606
 
206
607
  - Attempt to fix packaging problems by switching to newer version (1.15.1) of gnutar and setting COPY_EXTENDED_ATTRIBUTES_DISABLE environment variable.
207
608
  - Removed unused ExpectationSequenceError exception.
@@ -209,18 +610,18 @@ Hash with wrong number of entries.
209
610
  - Added Google Webmaster meta tag to rdoc template header.
210
611
  - Put Google Webmaster meta tag in the right header i.e. the one for the index page.
211
612
 
212
- = 0.5.2 (r159)
613
+ ## 0.5.2
213
614
 
214
615
  - Fix bug 11885 - "never doesn't work with stub_everything" submitted by Alexander Lang. In fixing this bug, also fixed undiscoverd bug where expected & actual invocation counts were being incorrectly reported which seems to have been introduced when fixes were added for invocation dispatch (see MockedMethodDispatchAcceptanceTest).
215
616
  - 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's see how it goes.
216
617
 
217
- = 0.5.1 (r149)
618
+ ## 0.5.1
218
619
 
219
620
  - Fixed bug #11583 "Mocha 0.5.0 throwing unexpected warnings". Also switched on ruby warning for all rake test tasks. Fixed majority of warnings, but some left to fix.
220
621
 
221
- = 0.5.0 (r147)
622
+ ## 0.5.0
222
623
 
223
- - Parameter Matchers - Ive 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() & any_of(). More to follow soon. The idea is eventually to get rid of the nasty parameter_block option on Expectation#with.
624
+ - Parameter Matchers - I'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() & any_of(). More to follow soon. The idea is eventually to get rid of the nasty parameter_block option on Expectation#with.
224
625
 
225
626
  object = mock()
226
627
  object.expects(:method).with(has_key('key_1'))
@@ -282,7 +683,7 @@ Hash with wrong number of entries.
282
683
  - Fiddled with mocha_inspect and tests to give more sensible results on x86 platform.
283
684
  - Fixed bug #7834 "infinite_range.rb makes incorrect assumption about to_f" logged by James Moore.
284
685
 
285
- = 0.4.0 (r92)
686
+ ## 0.4.0
286
687
 
287
688
  - Allow naming of mocks (patch from Chris Roos).
288
689
  - Specify multiple return values for consecutive calls.
@@ -302,19 +703,19 @@ Hash with wrong number of entries.
302
703
  - Stubba & SmartTestCase modules incorporated into Mocha module so only need to require 'mocha' - no longer need to require 'stubba'.
303
704
  - AutoMocha removed.
304
705
 
305
- = 0.3.3
706
+ ## 0.3.3
306
707
 
307
708
  - Quick bug fix to restore instance methods on partial mocks (for Kevin Clark).
308
709
 
309
- = 0.3.2
710
+ ## 0.3.2
310
711
 
311
712
  - Examples added.
312
713
 
313
- = 0.3.1
714
+ ## 0.3.1
314
715
 
315
716
  - Dual licensing with MIT license added.
316
717
 
317
- = 0.3.0
718
+ ## 0.3.0
318
719
 
319
720
  * Rails plugin.
320
721
  * Auto-verify for expectations on concrete classes.
@@ -325,11 +726,11 @@ Hash with wrong number of entries.
325
726
  * Create stubs which stub all method calls.
326
727
  * Mocks now respond_to? expected methods.
327
728
 
328
- = 0.2.1
729
+ ## 0.2.1
329
730
 
330
731
  * Rename MochaAcceptanceTest::Rover#move method to avoid conflict with Rake (in Ruby 1.8.4 only?)
331
732
 
332
- = 0.2.0
733
+ ## 0.2.0
333
734
 
334
735
  * Small change to SetupAndTeardown#teardown_stubs suggested by Luke Redpath (http://www.lukeredpath.co.uk) to allow use of Stubba with RSpec (http://rspec.rubyforge.org).
335
736
  * Reorganized directory structure and extracted addition of setup and teardown methods into SmartTestCase mini-library.
@@ -373,10 +774,10 @@ you can have...
373
774
 
374
775
  wotsit = stub(:thingummy => 5, :summat => 25)
375
776
 
376
- = 0.1.2
777
+ ## 0.1.2
377
778
 
378
779
  * Minor tweaks
379
780
 
380
- = 0.1.1
781
+ ## 0.1.1
381
782
 
382
783
  * Initial release.