mocha 1.10.2 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.yardopts +1 -0
  4. data/RELEASE.md +18 -0
  5. data/Rakefile +1 -4
  6. data/docs/Mocha.html +2 -2
  7. data/docs/Mocha/API.html +2 -2
  8. data/docs/Mocha/ClassMethods.html +2 -2
  9. data/docs/Mocha/Configuration.html +2 -2
  10. data/docs/Mocha/Expectation.html +284 -76
  11. data/docs/Mocha/ExpectationError.html +2 -2
  12. data/docs/Mocha/ExpectationErrorFactory.html +2 -2
  13. data/docs/Mocha/Hooks.html +2 -2
  14. data/docs/Mocha/Integration.html +2 -2
  15. data/docs/Mocha/Integration/MiniTest.html +2 -2
  16. data/docs/Mocha/Integration/MiniTest/Adapter.html +2 -2
  17. data/docs/Mocha/Integration/TestUnit.html +2 -2
  18. data/docs/Mocha/Integration/TestUnit/Adapter.html +2 -2
  19. data/docs/Mocha/Mock.html +2 -2
  20. data/docs/Mocha/ObjectMethods.html +2 -2
  21. data/docs/Mocha/ParameterMatchers.html +2 -2
  22. data/docs/Mocha/ParameterMatchers/AllOf.html +2 -2
  23. data/docs/Mocha/ParameterMatchers/AnyOf.html +2 -2
  24. data/docs/Mocha/ParameterMatchers/AnyParameters.html +2 -2
  25. data/docs/Mocha/ParameterMatchers/Anything.html +2 -2
  26. data/docs/Mocha/ParameterMatchers/Base.html +2 -2
  27. data/docs/Mocha/ParameterMatchers/Equals.html +2 -2
  28. data/docs/Mocha/ParameterMatchers/EquivalentUri.html +2 -2
  29. data/docs/Mocha/ParameterMatchers/HasEntries.html +2 -2
  30. data/docs/Mocha/ParameterMatchers/HasEntry.html +2 -2
  31. data/docs/Mocha/ParameterMatchers/HasKey.html +2 -2
  32. data/docs/Mocha/ParameterMatchers/HasValue.html +2 -2
  33. data/docs/Mocha/ParameterMatchers/Includes.html +2 -2
  34. data/docs/Mocha/ParameterMatchers/InstanceOf.html +2 -2
  35. data/docs/Mocha/ParameterMatchers/IsA.html +2 -2
  36. data/docs/Mocha/ParameterMatchers/KindOf.html +2 -2
  37. data/docs/Mocha/ParameterMatchers/Not.html +2 -2
  38. data/docs/Mocha/ParameterMatchers/Optionally.html +2 -2
  39. data/docs/Mocha/ParameterMatchers/RegexpMatches.html +2 -2
  40. data/docs/Mocha/ParameterMatchers/RespondsWith.html +2 -2
  41. data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +2 -2
  42. data/docs/Mocha/Sequence.html +2 -2
  43. data/docs/Mocha/StateMachine.html +2 -2
  44. data/docs/Mocha/StateMachine/State.html +2 -2
  45. data/docs/Mocha/StateMachine/StatePredicate.html +2 -2
  46. data/docs/Mocha/StubbingError.html +2 -2
  47. data/docs/_index.html +3 -3
  48. data/docs/file.COPYING.html +2 -2
  49. data/docs/file.MIT-LICENSE.html +2 -2
  50. data/docs/file.README.html +2 -2
  51. data/docs/file.RELEASE.html +30 -2
  52. data/docs/frames.html +1 -1
  53. data/docs/index.html +2 -2
  54. data/docs/method_list.html +20 -4
  55. data/docs/top-level-namespace.html +2 -2
  56. data/lib/mocha/block_matcher.rb +31 -0
  57. data/lib/mocha/expectation.rb +47 -6
  58. data/lib/mocha/invocation.rb +9 -5
  59. data/lib/mocha/version.rb +1 -1
  60. data/lib/mocha/yield_parameters.rb +5 -11
  61. data/test/acceptance/acceptance_test_helper.rb +1 -0
  62. data/test/acceptance/display_matching_invocations_alongside_expectations_test.rb +5 -5
  63. data/test/acceptance/failure_messages_test.rb +16 -0
  64. data/test/acceptance/multiple_yielding_test.rb +56 -0
  65. data/test/acceptance/yielding_test.rb +78 -0
  66. data/test/unit/expectation_test.rb +15 -1
  67. data/test/unit/yield_parameters_test.rb +35 -53
  68. metadata +6 -8
  69. data/lib/mocha/multiple_yields.rb +0 -15
  70. data/lib/mocha/no_yields.rb +0 -5
  71. data/lib/mocha/single_yield.rb +0 -13
  72. data/test/unit/multiple_yields_test.rb +0 -16
  73. data/test/unit/no_yields_test.rb +0 -16
  74. data/test/unit/single_yield_test.rb +0 -16
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::KindOf
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Dec 12 10:57:48 2019 by
146
+ Generated on Mon Dec 16 18:49:52 2019 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.9.20 (ruby-2.6.5).
149
149
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Not
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Dec 12 10:57:48 2019 by
146
+ Generated on Mon Dec 16 18:49:52 2019 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.9.20 (ruby-2.6.5).
149
149
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Optionally
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Dec 12 10:57:48 2019 by
146
+ Generated on Mon Dec 16 18:49:52 2019 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.9.20 (ruby-2.6.5).
149
149
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::RegexpMatches
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Dec 12 10:57:48 2019 by
146
+ Generated on Mon Dec 16 18:49:52 2019 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.9.20 (ruby-2.6.5).
149
149
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::RespondsWith
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Dec 12 10:57:48 2019 by
146
+ Generated on Mon Dec 16 18:49:52 2019 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.9.20 (ruby-2.6.5).
149
149
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::YamlEquivalent
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Dec 12 10:57:48 2019 by
146
+ Generated on Mon Dec 16 18:49:52 2019 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.9.20 (ruby-2.6.5).
149
149
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::Sequence
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -139,7 +139,7 @@
139
139
  </div>
140
140
 
141
141
  <div id="footer">
142
- Generated on Thu Dec 12 10:57:48 2019 by
142
+ Generated on Mon Dec 16 18:49:52 2019 by
143
143
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
144
144
  0.9.20 (ruby-2.6.5).
145
145
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StateMachine
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -517,7 +517,7 @@
517
517
  </div>
518
518
 
519
519
  <div id="footer">
520
- Generated on Thu Dec 12 10:57:48 2019 by
520
+ Generated on Mon Dec 16 18:49:52 2019 by
521
521
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
522
522
  0.9.20 (ruby-2.6.5).
523
523
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StateMachine::State
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -130,7 +130,7 @@
130
130
  </div>
131
131
 
132
132
  <div id="footer">
133
- Generated on Thu Dec 12 10:57:48 2019 by
133
+ Generated on Mon Dec 16 18:49:52 2019 by
134
134
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
135
135
  0.9.20 (ruby-2.6.5).
136
136
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StateMachine::StatePredicate
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -130,7 +130,7 @@
130
130
  </div>
131
131
 
132
132
  <div id="footer">
133
- Generated on Thu Dec 12 10:57:48 2019 by
133
+ Generated on Mon Dec 16 18:49:52 2019 by
134
134
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
135
135
  0.9.20 (ruby-2.6.5).
136
136
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StubbingError
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.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 Thu Dec 12 10:57:48 2019 by
143
+ Generated on Mon Dec 16 18:49:52 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.2
7
+ Mocha 1.11.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.2</h1>
55
+ <div id="content"><h1 class="noborder title">Mocha 1.11.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 Thu Dec 12 10:57:46 2019 by
512
+ Generated on Mon Dec 16 18:49:50 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.2
9
+ &mdash; Mocha 1.11.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 Thu Dec 12 10:57:46 2019 by
74
+ Generated on Mon Dec 16 18:49:50 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.2
9
+ &mdash; Mocha 1.11.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 Thu Dec 12 10:57:46 2019 by
78
+ Generated on Mon Dec 16 18:49:50 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.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -438,7 +438,7 @@ Pushed mocha 1.2.0 to rubygems.org.
438
438
  </div>
439
439
 
440
440
  <div id="footer">
441
- Generated on Thu Dec 12 10:57:46 2019 by
441
+ Generated on Mon Dec 16 18:49:50 2019 by
442
442
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
443
443
  0.9.20 (ruby-2.6.5).
444
444
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: RELEASE
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -59,6 +59,34 @@
59
59
 
60
60
  <div id="content"><div id='filecontents'><h1>Release Notes</h1>
61
61
 
62
+ <h2>1.11.0</h2>
63
+
64
+ <h3>External changes</h3>
65
+
66
+ <ul>
67
+ <li>Add <code>Expectation#with_block_given</code> &amp; <code>Expectation#with_no_block_given</code> (#441).
68
+
69
+ <ul>
70
+ <li>Allows non-deprecated solution for #382. Thanks to @yemartin for reporting and to @techbelly &amp; @nitishr for feedback.</li>
71
+ </ul></li>
72
+ <li>Fix issue with non-Array arguments passed to <code>Expectation#multiple_yields</code> (#444).
73
+
74
+ <ul>
75
+ <li>The undocumented behaviour is now properly supported and documented.</li>
76
+ </ul></li>
77
+ </ul>
78
+
79
+ <h3>Internal changes</h3>
80
+
81
+ <ul>
82
+ <li>Move static YARD options from Rake task to <code>.yardopts</code> file - thanks to @nitishr (#429)</li>
83
+ <li>Simplify implementation of yielding functionality - thanks to @nitishr (#439)</li>
84
+ <li>Add missing require statement to <code>acceptance_test_helper.rb</code> (1070fc02)</li>
85
+ <li>Add some baseline acceptance tests for yielding behaviour (c2cac911)</li>
86
+ <li>Display a sponsor button on GitHub repo page (9fc5911b)</li>
87
+ <li>Use new Deprecation.warning behaviour in <code>Invocation#call</code> (932d1166)</li>
88
+ </ul>
89
+
62
90
  <h2>1.10.2</h2>
63
91
 
64
92
  <ul>
@@ -964,7 +992,7 @@ Hash with wrong number of entries.</li>
964
992
  </div>
965
993
 
966
994
  <div id="footer">
967
- Generated on Thu Dec 12 10:57:46 2019 by
995
+ Generated on Mon Dec 16 18:49:50 2019 by
968
996
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
969
997
  0.9.20 (ruby-2.6.5).
970
998
  </div>
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Mocha 1.10.2</title>
5
+ <title>Mocha 1.11.0</title>
6
6
  </head>
7
7
  <script type="text/javascript" charset="utf-8">
8
8
  var match = unescape(window.location.hash).match(/^#!(.+)/);
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.0
10
10
 
11
11
  </title>
12
12
 
@@ -438,7 +438,7 @@ Pushed mocha 1.2.0 to rubygems.org.
438
438
  </div>
439
439
 
440
440
  <div id="footer">
441
- Generated on Thu Dec 12 10:57:46 2019 by
441
+ Generated on Mon Dec 16 18:49:50 2019 by
442
442
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
443
443
  0.9.20 (ruby-2.6.5).
444
444
  </div>
@@ -518,16 +518,16 @@
518
518
 
519
519
  <li class="even ">
520
520
  <div class="item">
521
- <span class='object_link'><a href="Mocha/Mock.html#stubs-instance_method" title="Mocha::Mock#stubs (method)">#stubs</a></span>
522
- <small>Mocha::Mock</small>
521
+ <span class='object_link'><a href="Mocha/ObjectMethods.html#stubs-instance_method" title="Mocha::ObjectMethods#stubs (method)">#stubs</a></span>
522
+ <small>Mocha::ObjectMethods</small>
523
523
  </div>
524
524
  </li>
525
525
 
526
526
 
527
527
  <li class="odd ">
528
528
  <div class="item">
529
- <span class='object_link'><a href="Mocha/ObjectMethods.html#stubs-instance_method" title="Mocha::ObjectMethods#stubs (method)">#stubs</a></span>
530
- <small>Mocha::ObjectMethods</small>
529
+ <span class='object_link'><a href="Mocha/Mock.html#stubs-instance_method" title="Mocha::Mock#stubs (method)">#stubs</a></span>
530
+ <small>Mocha::Mock</small>
531
531
  </div>
532
532
  </li>
533
533
 
@@ -604,6 +604,22 @@
604
604
  </li>
605
605
 
606
606
 
607
+ <li class="odd ">
608
+ <div class="item">
609
+ <span class='object_link'><a href="Mocha/Expectation.html#with_block_given-instance_method" title="Mocha::Expectation#with_block_given (method)">#with_block_given</a></span>
610
+ <small>Mocha::Expectation</small>
611
+ </div>
612
+ </li>
613
+
614
+
615
+ <li class="even ">
616
+ <div class="item">
617
+ <span class='object_link'><a href="Mocha/Expectation.html#with_no_block_given-instance_method" title="Mocha::Expectation#with_no_block_given (method)">#with_no_block_given</a></span>
618
+ <small>Mocha::Expectation</small>
619
+ </div>
620
+ </li>
621
+
622
+
607
623
  <li class="odd ">
608
624
  <div class="item">
609
625
  <span class='object_link'><a href="Mocha/ParameterMatchers.html#yaml_equivalent-instance_method" title="Mocha::ParameterMatchers#yaml_equivalent (method)">#yaml_equivalent</a></span>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Mocha 1.10.2
9
+ &mdash; Mocha 1.11.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 Thu Dec 12 10:57:46 2019 by
111
+ Generated on Mon Dec 16 18:49:50 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>
@@ -0,0 +1,31 @@
1
+ module Mocha
2
+ module BlockMatchers
3
+ class OptionalBlock
4
+ def match?(_actual_block)
5
+ true
6
+ end
7
+
8
+ def mocha_inspect; end
9
+ end
10
+
11
+ class BlockGiven
12
+ def match?(actual_block)
13
+ !actual_block.nil?
14
+ end
15
+
16
+ def mocha_inspect
17
+ 'with block given'
18
+ end
19
+ end
20
+
21
+ class NoBlockGiven
22
+ def match?(actual_block)
23
+ actual_block.nil?
24
+ end
25
+
26
+ def mocha_inspect
27
+ 'with no block given'
28
+ end
29
+ end
30
+ end
31
+ end