mocha 1.10.0.beta.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -0
  3. data/RELEASE.md +6 -0
  4. data/docs/Mocha.html +2 -2
  5. data/docs/Mocha/API.html +46 -22
  6. data/docs/Mocha/ClassMethods.html +2 -2
  7. data/docs/Mocha/Configuration.html +2 -2
  8. data/docs/Mocha/Expectation.html +2 -2
  9. data/docs/Mocha/ExpectationError.html +2 -2
  10. data/docs/Mocha/ExpectationErrorFactory.html +2 -2
  11. data/docs/Mocha/Hooks.html +2 -2
  12. data/docs/Mocha/Integration.html +2 -2
  13. data/docs/Mocha/Integration/MiniTest.html +2 -2
  14. data/docs/Mocha/Integration/MiniTest/Adapter.html +2 -2
  15. data/docs/Mocha/Integration/TestUnit.html +2 -2
  16. data/docs/Mocha/Integration/TestUnit/Adapter.html +2 -2
  17. data/docs/Mocha/Mock.html +2 -2
  18. data/docs/Mocha/ObjectMethods.html +2 -2
  19. data/docs/Mocha/ParameterMatchers.html +2 -2
  20. data/docs/Mocha/ParameterMatchers/AllOf.html +2 -2
  21. data/docs/Mocha/ParameterMatchers/AnyOf.html +2 -2
  22. data/docs/Mocha/ParameterMatchers/AnyParameters.html +2 -2
  23. data/docs/Mocha/ParameterMatchers/Anything.html +2 -2
  24. data/docs/Mocha/ParameterMatchers/Base.html +2 -2
  25. data/docs/Mocha/ParameterMatchers/Equals.html +2 -2
  26. data/docs/Mocha/ParameterMatchers/EquivalentUri.html +2 -2
  27. data/docs/Mocha/ParameterMatchers/HasEntries.html +2 -2
  28. data/docs/Mocha/ParameterMatchers/HasEntry.html +2 -2
  29. data/docs/Mocha/ParameterMatchers/HasKey.html +2 -2
  30. data/docs/Mocha/ParameterMatchers/HasValue.html +2 -2
  31. data/docs/Mocha/ParameterMatchers/Includes.html +2 -2
  32. data/docs/Mocha/ParameterMatchers/InstanceOf.html +2 -2
  33. data/docs/Mocha/ParameterMatchers/IsA.html +2 -2
  34. data/docs/Mocha/ParameterMatchers/KindOf.html +2 -2
  35. data/docs/Mocha/ParameterMatchers/Not.html +2 -2
  36. data/docs/Mocha/ParameterMatchers/Optionally.html +2 -2
  37. data/docs/Mocha/ParameterMatchers/RegexpMatches.html +2 -2
  38. data/docs/Mocha/ParameterMatchers/RespondsWith.html +2 -2
  39. data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +2 -2
  40. data/docs/Mocha/Sequence.html +2 -2
  41. data/docs/Mocha/StateMachine.html +2 -2
  42. data/docs/Mocha/StateMachine/State.html +2 -2
  43. data/docs/Mocha/StateMachine/StatePredicate.html +2 -2
  44. data/docs/Mocha/StubbingError.html +2 -2
  45. data/docs/_index.html +3 -3
  46. data/docs/file.COPYING.html +2 -2
  47. data/docs/file.MIT-LICENSE.html +2 -2
  48. data/docs/file.README.html +21 -2
  49. data/docs/file.RELEASE.html +10 -2
  50. data/docs/frames.html +1 -1
  51. data/docs/index.html +21 -2
  52. data/docs/top-level-namespace.html +2 -2
  53. data/lib/mocha/api.rb +3 -0
  54. data/lib/mocha/setup.rb +1 -1
  55. data/lib/mocha/version.rb +1 -1
  56. metadata +4 -4
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StubbingError
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -140,7 +140,7 @@
140
140
  </div>
141
141
 
142
142
  <div id="footer">
143
- Generated on Tue Nov 26 21:53:04 2019 by
143
+ Generated on Mon Dec 2 17:48:41 2019 by
144
144
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
145
145
  0.9.20 (ruby-2.6.5).
146
146
  </div>
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
- Mocha 1.10.0.beta.1
7
+ Mocha 1.10.0
8
8
 
9
9
  </title>
10
10
 
@@ -52,7 +52,7 @@
52
52
  <div class="clear"></div>
53
53
  </div>
54
54
 
55
- <div id="content"><h1 class="noborder title">Mocha 1.10.0.beta.1</h1>
55
+ <div id="content"><h1 class="noborder title">Mocha 1.10.0</h1>
56
56
  <div id="listing">
57
57
  <h1 class="alphaindex">Alphabetic Index</h1>
58
58
 
@@ -509,7 +509,7 @@
509
509
  </div>
510
510
 
511
511
  <div id="footer">
512
- Generated on Tue Nov 26 21:53:01 2019 by
512
+ Generated on Mon Dec 2 17:48:39 2019 by
513
513
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
514
514
  0.9.20 (ruby-2.6.5).
515
515
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: COPYING
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -71,7 +71,7 @@
71
71
  </div>
72
72
 
73
73
  <div id="footer">
74
- Generated on Tue Nov 26 21:53:01 2019 by
74
+ Generated on Mon Dec 2 17:48:39 2019 by
75
75
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
76
76
  0.9.20 (ruby-2.6.5).
77
77
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: MIT-LICENSE
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -75,7 +75,7 @@
75
75
  </div>
76
76
 
77
77
  <div id="footer">
78
- Generated on Tue Nov 26 21:53:01 2019 by
78
+ Generated on Mon Dec 2 17:48:39 2019 by
79
79
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
80
80
  0.9.20 (ruby-2.6.5).
81
81
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -157,9 +157,28 @@
157
157
  </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/minitest</span><span class='tstring_end'>&#39;</span></span>
158
158
  </code></pre>
159
159
 
160
+ <h5>Cucumber</h5>
161
+
162
+ <pre class="code ruby"><code class="ruby"><span class='comment'># In e.g. features/support/mocha.rb
163
+ </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/api</span><span class='tstring_end'>&#39;</span></span>
164
+
165
+ <span class='const'>World</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Mocha.html" title="Mocha (module)">Mocha</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mocha/API.html" title="Mocha::API (module)">API</a></span></span><span class='rparen'>)</span>
166
+
167
+ <span class='const'>Around</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_scenario'>scenario</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
168
+ <span class='kw'>begin</span>
169
+ <span class='id identifier rubyid_mocha_setup'>mocha_setup</span>
170
+ <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
171
+ <span class='id identifier rubyid_mocha_verify'>mocha_verify</span>
172
+ <span class='kw'>ensure</span>
173
+ <span class='id identifier rubyid_mocha_teardown'>mocha_teardown</span>
174
+ <span class='kw'>end</span>
175
+ <span class='kw'>end</span>
176
+ </code></pre>
177
+
160
178
  <h4>Known Issues</h4>
161
179
 
162
180
  <ul>
181
+ <li>In Mocha v1.10.0 an undocumented feature of <code>API#mock</code>, <code>API#stub</code> &amp; <code>API#stub_everything</code> was changed. Previously when these methods were passed a single symbol, they returned a mock object that responded to the method identified by the symbol. Now Passing a single symbol is equivalent to passing a single string, i.e. it now defines the &quot;name&quot; of the mock object.</li>
163
182
  <li>In Mocha v1.2.0 there is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to <a href="https://bugs.ruby-lang.org/issues/12832">a bug in Ruby v2.3.1</a>. See #272. This was fixed in Mocha v1.2.1.</li>
164
183
  <li>Since v1.1.0 Mocha has used prepended modules internally for stubbing methods. There is <a href="https://bugs.ruby-lang.org/issues/12876">an obscure Ruby bug</a> in many (but not all) versions of Ruby between v2.0 &amp; v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 &amp; v2.4.0.</li>
165
184
  <li>Stubbing an aliased class method, where the original method is defined in a module that&#39;s used to <code>extend</code> the class doesn&#39;t work in Ruby 1.8.x. See stub_method_defined_on_module_and_aliased_test.rb for an example of this behaviour.</li>
@@ -419,7 +438,7 @@ Pushed mocha 1.2.0 to rubygems.org.
419
438
  </div>
420
439
 
421
440
  <div id="footer">
422
- Generated on Tue Nov 26 21:53:01 2019 by
441
+ Generated on Mon Dec 2 17:48:39 2019 by
423
442
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
424
443
  0.9.20 (ruby-2.6.5).
425
444
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: RELEASE
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -59,6 +59,14 @@
59
59
 
60
60
  <div id="content"><div id='filecontents'><h1>Release Notes</h1>
61
61
 
62
+ <h2>1.10.0</h2>
63
+
64
+ <ul>
65
+ <li>Improve deprecation warning when requiring &#39;mocha/setup&#39; (388f44d7)</li>
66
+ <li>Add documentation for Cucumber integration (13ab797b)</li>
67
+ <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>
68
+ </ul>
69
+
62
70
  <h2>1.10.0.beta.1</h2>
63
71
 
64
72
  <ul>
@@ -938,7 +946,7 @@ Hash with wrong number of entries.</li>
938
946
  </div>
939
947
 
940
948
  <div id="footer">
941
- Generated on Tue Nov 26 21:53:01 2019 by
949
+ Generated on Mon Dec 2 17:48:39 2019 by
942
950
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
943
951
  0.9.20 (ruby-2.6.5).
944
952
  </div>
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Mocha 1.10.0.beta.1</title>
5
+ <title>Mocha 1.10.0</title>
6
6
  </head>
7
7
  <script type="text/javascript" charset="utf-8">
8
8
  var match = unescape(window.location.hash).match(/^#!(.+)/);
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -157,9 +157,28 @@
157
157
  </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/minitest</span><span class='tstring_end'>&#39;</span></span>
158
158
  </code></pre>
159
159
 
160
+ <h5>Cucumber</h5>
161
+
162
+ <pre class="code ruby"><code class="ruby"><span class='comment'># In e.g. features/support/mocha.rb
163
+ </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mocha/api</span><span class='tstring_end'>&#39;</span></span>
164
+
165
+ <span class='const'>World</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Mocha.html" title="Mocha (module)">Mocha</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mocha/API.html" title="Mocha::API (module)">API</a></span></span><span class='rparen'>)</span>
166
+
167
+ <span class='const'>Around</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_scenario'>scenario</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
168
+ <span class='kw'>begin</span>
169
+ <span class='id identifier rubyid_mocha_setup'>mocha_setup</span>
170
+ <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
171
+ <span class='id identifier rubyid_mocha_verify'>mocha_verify</span>
172
+ <span class='kw'>ensure</span>
173
+ <span class='id identifier rubyid_mocha_teardown'>mocha_teardown</span>
174
+ <span class='kw'>end</span>
175
+ <span class='kw'>end</span>
176
+ </code></pre>
177
+
160
178
  <h4>Known Issues</h4>
161
179
 
162
180
  <ul>
181
+ <li>In Mocha v1.10.0 an undocumented feature of <code>API#mock</code>, <code>API#stub</code> &amp; <code>API#stub_everything</code> was changed. Previously when these methods were passed a single symbol, they returned a mock object that responded to the method identified by the symbol. Now Passing a single symbol is equivalent to passing a single string, i.e. it now defines the &quot;name&quot; of the mock object.</li>
163
182
  <li>In Mocha v1.2.0 there is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to <a href="https://bugs.ruby-lang.org/issues/12832">a bug in Ruby v2.3.1</a>. See #272. This was fixed in Mocha v1.2.1.</li>
164
183
  <li>Since v1.1.0 Mocha has used prepended modules internally for stubbing methods. There is <a href="https://bugs.ruby-lang.org/issues/12876">an obscure Ruby bug</a> in many (but not all) versions of Ruby between v2.0 &amp; v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 &amp; v2.4.0.</li>
165
184
  <li>Stubbing an aliased class method, where the original method is defined in a module that&#39;s used to <code>extend</code> the class doesn&#39;t work in Ruby 1.8.x. See stub_method_defined_on_module_and_aliased_test.rb for an example of this behaviour.</li>
@@ -419,7 +438,7 @@ Pushed mocha 1.2.0 to rubygems.org.
419
438
  </div>
420
439
 
421
440
  <div id="footer">
422
- Generated on Tue Nov 26 21:53:01 2019 by
441
+ Generated on Mon Dec 2 17:48:39 2019 by
423
442
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
424
443
  0.9.20 (ruby-2.6.5).
425
444
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Mocha 1.10.0.beta.1
9
+ &mdash; Mocha 1.10.0
10
10
 
11
11
  </title>
12
12
 
@@ -108,7 +108,7 @@
108
108
  </div>
109
109
 
110
110
  <div id="footer">
111
- Generated on Tue Nov 26 21:53:01 2019 by
111
+ Generated on Mon Dec 2 17:48:39 2019 by
112
112
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
113
113
  0.9.20 (ruby-2.6.5).
114
114
  </div>
@@ -46,6 +46,7 @@ module Mocha
46
46
  #
47
47
  # @overload def mock(name)
48
48
  # @param [String, Symbol] name identifies mock object in error messages.
49
+ # @note Prior to v1.10.0 when +name+ was a +Symbol+, this method returned an unnamed +Mock+ that stubbed the method identified by +name+. This was undocumented behaviour and it no longer exists.
49
50
  # @overload def mock(expected_methods_vs_return_values = {})
50
51
  # @param [Hash] expected_methods_vs_return_values expected method name symbols as keys and corresponding return values as values - these expectations are setup as if {Mock#expects} were called multiple times.
51
52
  # @overload def mock(name, expected_methods_vs_return_values = {})
@@ -69,6 +70,7 @@ module Mocha
69
70
  #
70
71
  # @overload def stub(name)
71
72
  # @param [String, Symbol] name identifies mock object in error messages.
73
+ # @note Prior to v1.10.0 when +name+ was a +Symbol+, this method returned an unnamed +Mock+ that stubbed the method identified by +name+. This was undocumented behaviour and it no longer exists.
72
74
  # @overload def stub(stubbed_methods_vs_return_values = {})
73
75
  # @param [Hash] stubbed_methods_vs_return_values stubbed method name symbols as keys and corresponding return values as values - these stubbed methods are setup as if {Mock#stubs} were called multiple times.
74
76
  # @overload def stub(name, stubbed_methods_vs_return_values = {})
@@ -91,6 +93,7 @@ module Mocha
91
93
  #
92
94
  # @overload def stub_everything(name)
93
95
  # @param [String, Symbol] name identifies mock object in error messages.
96
+ # @note Prior to v1.10.0 when +name+ was a +Symbol+, this method returned an unnamed +Mock+ that stubbed everything. This was undocumented behaviour and it no longer exists.
94
97
  # @overload def stub_everything(stubbed_methods_vs_return_values = {})
95
98
  # @param [Hash] stubbed_methods_vs_return_values stubbed method name symbols as keys and corresponding return values as values - these stubbed methods are setup as if {Mock#stubs} were called multiple times.
96
99
  # @overload def stub_everything(name, stubbed_methods_vs_return_values = {})
@@ -2,7 +2,7 @@ require 'mocha/integration'
2
2
  require 'mocha/deprecation'
3
3
 
4
4
  Mocha::Deprecation.warning(
5
- "Use `require 'mocha/test_unit'` or `require 'mocha/minitest'` instead."
5
+ "Require 'mocha/test_unit', 'mocha/minitest' or 'mocha/api' instead of 'mocha/setup'."
6
6
  )
7
7
 
8
8
  module Mocha
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '1.10.0.beta.1'.freeze
2
+ VERSION = '1.10.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0.beta.1
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Mead
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-26 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -409,9 +409,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
409
409
  version: 1.8.7
410
410
  required_rubygems_version: !ruby/object:Gem::Requirement
411
411
  requirements:
412
- - - ">"
412
+ - - ">="
413
413
  - !ruby/object:Gem::Version
414
- version: 1.3.1
414
+ version: '0'
415
415
  requirements: []
416
416
  rubygems_version: 3.0.3
417
417
  signing_key: