mocha 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/RELEASE.rdoc +4 -1
  2. data/doc/Mocha.html +2 -2
  3. data/doc/Mocha/API.html +2 -2
  4. data/doc/Mocha/ClassMethods.html +2 -2
  5. data/doc/Mocha/Configuration.html +2 -2
  6. data/doc/Mocha/Expectation.html +2 -2
  7. data/doc/Mocha/Mock.html +2 -2
  8. data/doc/Mocha/ObjectMethods.html +2 -2
  9. data/doc/Mocha/ParameterMatchers.html +2 -2
  10. data/doc/Mocha/ParameterMatchers/AllOf.html +2 -2
  11. data/doc/Mocha/ParameterMatchers/AnyOf.html +2 -2
  12. data/doc/Mocha/ParameterMatchers/AnyParameters.html +2 -2
  13. data/doc/Mocha/ParameterMatchers/Anything.html +2 -2
  14. data/doc/Mocha/ParameterMatchers/Base.html +2 -2
  15. data/doc/Mocha/ParameterMatchers/Equals.html +2 -2
  16. data/doc/Mocha/ParameterMatchers/HasEntries.html +2 -2
  17. data/doc/Mocha/ParameterMatchers/HasEntry.html +2 -2
  18. data/doc/Mocha/ParameterMatchers/HasKey.html +2 -2
  19. data/doc/Mocha/ParameterMatchers/HasValue.html +2 -2
  20. data/doc/Mocha/ParameterMatchers/Includes.html +2 -2
  21. data/doc/Mocha/ParameterMatchers/InstanceOf.html +2 -2
  22. data/doc/Mocha/ParameterMatchers/IsA.html +2 -2
  23. data/doc/Mocha/ParameterMatchers/KindOf.html +2 -2
  24. data/doc/Mocha/ParameterMatchers/Not.html +2 -2
  25. data/doc/Mocha/ParameterMatchers/Optionally.html +2 -2
  26. data/doc/Mocha/ParameterMatchers/QueryStringMatches.html +2 -2
  27. data/doc/Mocha/ParameterMatchers/RegexpMatches.html +2 -2
  28. data/doc/Mocha/ParameterMatchers/RespondsWith.html +2 -2
  29. data/doc/Mocha/ParameterMatchers/YamlEquivalent.html +2 -2
  30. data/doc/Mocha/Sequence.html +2 -2
  31. data/doc/Mocha/StateMachine.html +2 -2
  32. data/doc/Mocha/StateMachine/State.html +2 -2
  33. data/doc/Mocha/StateMachine/StatePredicate.html +2 -2
  34. data/doc/Mocha/StubbingError.html +2 -2
  35. data/doc/Mocha/UnexpectedInvocation.html +2 -2
  36. data/doc/_index.html +3 -3
  37. data/doc/file.COPYING.html +2 -2
  38. data/doc/file.MIT-LICENSE.html +2 -2
  39. data/doc/file.README.html +2 -2
  40. data/doc/file.RELEASE.html +9 -3
  41. data/doc/file.misc.html +2 -2
  42. data/doc/file.mocha.html +2 -2
  43. data/doc/file.stubba.html +2 -2
  44. data/doc/frames.html +1 -1
  45. data/doc/index.html +2 -2
  46. data/doc/top-level-namespace.html +2 -2
  47. data/lib/mocha/class_method.rb +4 -1
  48. data/lib/mocha/version.rb +1 -1
  49. data/test/acceptance/stubbing_method_accepting_block_parameter_test.rb +48 -0
  50. data/test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb +1 -1
  51. data/test/unit/class_method_test.rb +14 -0
  52. metadata +12 -11
@@ -1,4 +1,7 @@
1
- = 0.11.0 ()
1
+ = 0.11.1 ()
2
+ * In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76.
3
+
4
+ = 0.11.0 (fa601c89a7f5314dc3d258391a99c6a9e25cefb3)
2
5
  * 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.
3
6
  * Attempting to stub a method on a frozen object should fail fast. See #68.
4
7
  * Prevent stubbing a method on nil by default. See #68.
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Mocha
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Thu Apr 19 10:54:34 2012 by
106
+ Generated on Sat Apr 21 11:46:13 2012 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.7.5 (ruby-1.9.3).
109
109
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Mocha::API
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -889,7 +889,7 @@ alternative way to setup stubbed methods.</p>
889
889
  </div>
890
890
 
891
891
  <div id="footer">
892
- Generated on Thu Apr 19 10:54:34 2012 by
892
+ Generated on Sat Apr 21 11:46:13 2012 by
893
893
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
894
894
  0.7.5 (ruby-1.9.3).
895
895
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Mocha::ClassMethods
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -237,7 +237,7 @@ non-mock) objects.</p>
237
237
  </div>
238
238
 
239
239
  <div id="footer">
240
- Generated on Thu Apr 19 10:54:34 2012 by
240
+ Generated on Sat Apr 21 11:46:13 2012 by
241
241
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
242
242
  0.7.5 (ruby-1.9.3).
243
243
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::Configuration
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -462,7 +462,7 @@ being returned to its original value at the end of the block.</p>
462
462
  </div>
463
463
 
464
464
  <div id="footer">
465
- Generated on Thu Apr 19 10:54:34 2012 by
465
+ Generated on Sat Apr 21 11:46:13 2012 by
466
466
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
467
467
  0.7.5 (ruby-1.9.3).
468
468
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::Expectation
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -2561,7 +2561,7 @@ methods to be chained.</p>
2561
2561
  </div>
2562
2562
 
2563
2563
  <div id="footer">
2564
- Generated on Thu Apr 19 10:54:34 2012 by
2564
+ Generated on Sat Apr 21 11:46:13 2012 by
2565
2565
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2566
2566
  0.7.5 (ruby-1.9.3).
2567
2567
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::Mock
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -821,7 +821,7 @@ object.stubbed_method # =&gt; unexpected invocation: #&lt;Mock:mock&gt;.stubbed_
821
821
  </div>
822
822
 
823
823
  <div id="footer">
824
- Generated on Thu Apr 19 10:54:34 2012 by
824
+ Generated on Sat Apr 21 11:46:13 2012 by
825
825
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
826
826
  0.7.5 (ruby-1.9.3).
827
827
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Mocha::ObjectMethods
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -659,7 +659,7 @@ satisfied. Use <span class='object_link'><a href="#unstub-instance_method" title
659
659
  </div>
660
660
 
661
661
  <div id="footer">
662
- Generated on Thu Apr 19 10:54:34 2012 by
662
+ Generated on Sat Apr 21 11:46:13 2012 by
663
663
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
664
664
  0.7.5 (ruby-1.9.3).
665
665
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Mocha::ParameterMatchers
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -2706,7 +2706,7 @@ To put it another way, it tests the quack, not the duck.</p>
2706
2706
  </div>
2707
2707
 
2708
2708
  <div id="footer">
2709
- Generated on Thu Apr 19 10:54:34 2012 by
2709
+ Generated on Sat Apr 21 11:46:13 2012 by
2710
2710
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2711
2711
  0.7.5 (ruby-1.9.3).
2712
2712
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::AllOf
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ AND.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:13 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::AnyOf
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ OR.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:13 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::AnyParameters
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -127,7 +127,7 @@
127
127
  </div>
128
128
 
129
129
  <div id="footer">
130
- Generated on Thu Apr 19 10:54:34 2012 by
130
+ Generated on Sat Apr 21 11:46:14 2012 by
131
131
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
132
132
  0.7.5 (ruby-1.9.3).
133
133
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Anything
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -127,7 +127,7 @@
127
127
  </div>
128
128
 
129
129
  <div id="footer">
130
- Generated on Thu Apr 19 10:54:34 2012 by
130
+ Generated on Sat Apr 21 11:46:14 2012 by
131
131
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
132
132
  0.7.5 (ruby-1.9.3).
133
133
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Base
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -410,7 +410,7 @@ explicit <span class='object_link'><a href="Equals.html" title="Mocha::Parameter
410
410
  </div>
411
411
 
412
412
  <div id="footer">
413
- Generated on Thu Apr 19 10:54:34 2012 by
413
+ Generated on Sat Apr 21 11:46:13 2012 by
414
414
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
415
415
  0.7.5 (ruby-1.9.3).
416
416
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Equals
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ value.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:13 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::HasEntries
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::HasEntry
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::HasKey
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:13 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::HasValue
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Includes
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ value.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::InstanceOf
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ specified class.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::IsA
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -127,7 +127,7 @@
127
127
  </div>
128
128
 
129
129
  <div id="footer">
130
- Generated on Thu Apr 19 10:54:34 2012 by
130
+ Generated on Sat Apr 21 11:46:13 2012 by
131
131
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
132
132
  0.7.5 (ruby-1.9.3).
133
133
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::KindOf
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ specified class.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:13 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Not
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ logical NOT operation.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:13 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::Optionally
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -127,7 +127,7 @@
127
127
  </div>
128
128
 
129
129
  <div id="footer">
130
- Generated on Thu Apr 19 10:54:34 2012 by
130
+ Generated on Sat Apr 21 11:46:14 2012 by
131
131
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
132
132
  0.7.5 (ruby-1.9.3).
133
133
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::QueryStringMatches
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -127,7 +127,7 @@
127
127
  </div>
128
128
 
129
129
  <div id="footer">
130
- Generated on Thu Apr 19 10:54:34 2012 by
130
+ Generated on Sat Apr 21 11:46:14 2012 by
131
131
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
132
132
  0.7.5 (ruby-1.9.3).
133
133
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::RegexpMatches
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ actual paramter.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::RespondsWith
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ when specified method is invoked.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::ParameterMatchers::YamlEquivalent
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -128,7 +128,7 @@ specified object.</p>
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Apr 19 10:54:34 2012 by
131
+ Generated on Sat Apr 21 11:46:14 2012 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.7.5 (ruby-1.9.3).
134
134
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::Sequence
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -124,7 +124,7 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Thu Apr 19 10:54:34 2012 by
127
+ Generated on Sat Apr 21 11:46:13 2012 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
129
  0.7.5 (ruby-1.9.3).
130
130
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StateMachine
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -501,7 +501,7 @@ to be chained.</p>
501
501
  </div>
502
502
 
503
503
  <div id="footer">
504
- Generated on Thu Apr 19 10:54:34 2012 by
504
+ Generated on Sat Apr 21 11:46:13 2012 by
505
505
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
506
506
  0.7.5 (ruby-1.9.3).
507
507
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StateMachine::State
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -116,7 +116,7 @@ in the future.</p>
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Thu Apr 19 10:54:34 2012 by
119
+ Generated on Sat Apr 21 11:46:13 2012 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.7.5 (ruby-1.9.3).
122
122
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::StateMachine::StatePredicate
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -116,7 +116,7 @@ specified state at some point in the future.</p>
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Thu Apr 19 10:54:34 2012 by
119
+ Generated on Sat Apr 21 11:46:13 2012 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.7.5 (ruby-1.9.3).
122
122
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Mocha::StubbingError
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -125,7 +125,7 @@
125
125
  </div>
126
126
 
127
127
  <div id="footer">
128
- Generated on Thu Apr 19 10:54:34 2012 by
128
+ Generated on Sat Apr 21 11:46:13 2012 by
129
129
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
130
  0.7.5 (ruby-1.9.3).
131
131
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Mocha::UnexpectedInvocation
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -115,7 +115,7 @@
115
115
  </div>
116
116
 
117
117
  <div id="footer">
118
- Generated on Thu Apr 19 10:54:34 2012 by
118
+ Generated on Sat Apr 21 11:46:13 2012 by
119
119
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
120
120
  0.7.5 (ruby-1.9.3).
121
121
  </div>
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
6
  <title>
7
- Mocha 0.11.0
7
+ Mocha 0.11.1
8
8
 
9
9
  </title>
10
10
 
@@ -52,7 +52,7 @@
52
52
 
53
53
  <iframe id="search_frame"></iframe>
54
54
 
55
- <div id="content"><h1 class="noborder title">Mocha 0.11.0</h1>
55
+ <div id="content"><h1 class="noborder title">Mocha 0.11.1</h1>
56
56
  <div id="listing">
57
57
  <h1 class="alphaindex">Alphabetic Index</h1>
58
58
 
@@ -472,7 +472,7 @@
472
472
  </div>
473
473
 
474
474
  <div id="footer">
475
- Generated on Thu Apr 19 10:54:33 2012 by
475
+ Generated on Sat Apr 21 11:46:13 2012 by
476
476
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
477
477
  0.7.5 (ruby-1.9.3).
478
478
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: COPYING
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -63,7 +63,7 @@ href="http://www.ruby-lang.org/en/LICENSE.txt">Ruby itself</a> or under the
63
63
  </div></div>
64
64
 
65
65
  <div id="footer">
66
- Generated on Thu Apr 19 10:54:33 2012 by
66
+ Generated on Sat Apr 21 11:46:13 2012 by
67
67
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
68
68
  0.7.5 (ruby-1.9.3).
69
69
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: MIT-LICENSE
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -77,7 +77,7 @@ DEALINGS IN THE SOFTWARE.</p>
77
77
  </div></div>
78
78
 
79
79
  <div id="footer">
80
- Generated on Thu Apr 19 10:54:34 2012 by
80
+ Generated on Sat Apr 21 11:46:13 2012 by
81
81
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
82
82
  0.7.5 (ruby-1.9.3).
83
83
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -144,7 +144,7 @@ href="http://www.ruby-lang.org/en/LICENSE.txt">Ruby itself</a> or under the
144
144
  </div></div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Apr 19 10:54:33 2012 by
147
+ Generated on Sat Apr 21 11:46:13 2012 by
148
148
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.7.5 (ruby-1.9.3).
150
150
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: RELEASE
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -55,7 +55,13 @@
55
55
  <iframe id="search_frame"></iframe>
56
56
 
57
57
  <div id="content"><div id='filecontents'>
58
- <h1>0.11.0 ()</h1>
58
+ <h1>0.11.1 ()</h1>
59
+ <ul><li>
60
+ <p>In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored
61
+ without the block parameter after being stubbed. Fix for #76.</p>
62
+ </li></ul>
63
+
64
+ <h1>0.11.0 (fa601c89a7f5314dc3d258391a99c6a9e25cefb3)</h1>
59
65
  <ul><li>
60
66
  <p>Store original method when stubbing rather than using alias_method. This
61
67
  fixes #41, #47, #74 and all tests now pass on both Ruby 1.8.7 and 1.9.3.</p>
@@ -924,7 +930,7 @@ a mock will automatically get verified.</p>
924
930
  </div></div>
925
931
 
926
932
  <div id="footer">
927
- Generated on Thu Apr 19 10:54:33 2012 by
933
+ Generated on Sat Apr 21 11:46:13 2012 by
928
934
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
929
935
  0.7.5 (ruby-1.9.3).
930
936
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: misc
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -99,7 +99,7 @@
99
99
  <span class='kw'>end</span></pre></div></div>
100
100
 
101
101
  <div id="footer">
102
- Generated on Thu Apr 19 10:54:34 2012 by
102
+ Generated on Sat Apr 21 11:46:13 2012 by
103
103
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
104
104
  0.7.5 (ruby-1.9.3).
105
105
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: mocha
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -81,7 +81,7 @@
81
81
  <span class='kw'>end</span></pre></div></div>
82
82
 
83
83
  <div id="footer">
84
- Generated on Thu Apr 19 10:54:34 2012 by
84
+ Generated on Sat Apr 21 11:46:13 2012 by
85
85
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
86
86
  0.7.5 (ruby-1.9.3).
87
87
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: stubba
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -120,7 +120,7 @@
120
120
  <span class='kw'>end</span></pre></div></div>
121
121
 
122
122
  <div id="footer">
123
- Generated on Thu Apr 19 10:54:34 2012 by
123
+ Generated on Sat Apr 21 11:46:13 2012 by
124
124
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
125
125
  0.7.5 (ruby-1.9.3).
126
126
  </div>
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
- <title>Mocha 0.11.0</title>
7
+ <title>Mocha 0.11.1</title>
8
8
  </head>
9
9
  <frameset cols="20%,*">
10
10
  <frame name="list" src="class_list.html" />
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -144,7 +144,7 @@ href="http://www.ruby-lang.org/en/LICENSE.txt">Ruby itself</a> or under the
144
144
  </div></div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Apr 19 10:54:33 2012 by
147
+ Generated on Sat Apr 21 11:46:13 2012 by
148
148
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.7.5 (ruby-1.9.3).
150
150
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Mocha 0.11.0
9
+ &mdash; Mocha 0.11.1
10
10
 
11
11
  </title>
12
12
 
@@ -96,7 +96,7 @@
96
96
  </div>
97
97
 
98
98
  <div id="footer">
99
- Generated on Thu Apr 19 10:54:34 2012 by
99
+ Generated on Sat Apr 21 11:46:14 2012 by
100
100
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
101
101
  0.7.5 (ruby-1.9.3).
102
102
  </div>
@@ -66,7 +66,10 @@ module Mocha
66
66
 
67
67
  def restore_original_method
68
68
  if @original_method && @original_method.owner == stubbee.__metaclass__
69
- stubbee.__metaclass__.send(:define_method, method, @original_method.to_proc)
69
+ original_method = @original_method
70
+ stubbee.__metaclass__.send(:define_method, method) do |*args, &block|
71
+ original_method.call(*args, &block)
72
+ end
70
73
  stubbee.__metaclass__.send(@original_visibility, method)
71
74
  end
72
75
  end
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
  end
@@ -0,0 +1,48 @@
1
+ require File.expand_path('../acceptance_test_helper', __FILE__)
2
+ require 'mocha'
3
+
4
+ class StubbingMethodAcceptingBlockParameterTest < Test::Unit::TestCase
5
+
6
+ include AcceptanceTest
7
+
8
+ def setup
9
+ setup_acceptance_test
10
+ end
11
+
12
+ def teardown
13
+ teardown_acceptance_test
14
+ end
15
+
16
+ def test_stubbing_class_method_accepting_block_parameter_should_restore_original_method
17
+ klass = Class.new do
18
+ def self.my_class_method(&block); block.call; end
19
+ end
20
+ test_result = run_as_test do
21
+ klass.stubs(:my_class_method)
22
+ end
23
+ assert_passed(test_result)
24
+ assert_equal :return_value, klass.my_class_method { :return_value }
25
+ end
26
+
27
+ def test_stubbing_instance_method_accepting_block_parameter_should_restore_original_method
28
+ instance = Class.new do
29
+ def my_instance_method(&block); block.call; end
30
+ end.new
31
+ test_result = run_as_test do
32
+ instance.stubs(:my_instance_method)
33
+ end
34
+ assert_passed(test_result)
35
+ assert_equal :return_value, instance.my_instance_method { :return_value }
36
+ end
37
+
38
+ def test_stubbing_any_instance_method_accepting_block_parameter_should_restore_original_method
39
+ klass = Class.new do
40
+ def my_instance_method(&block); block.call; end
41
+ end
42
+ test_result = run_as_test do
43
+ klass.any_instance.stubs(:my_instance_method)
44
+ end
45
+ assert_passed(test_result)
46
+ assert_equal :return_value, klass.new.my_instance_method { :return_value }
47
+ end
48
+ end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../acceptance_test_helper', __FILE__)
2
2
  require 'mocha'
3
3
 
4
- class Issue74Test < Test::Unit::TestCase
4
+ class StubbingSameClassMethodOnParentAndChildClassTest < Test::Unit::TestCase
5
5
 
6
6
  include AcceptanceTest
7
7
 
@@ -61,6 +61,20 @@ class ClassMethodTest < Test::Unit::TestCase
61
61
  assert_equal :original_result, klass.method_x
62
62
  end
63
63
 
64
+ def test_should_restore_original_method_accepting_a_block_parameter
65
+ klass = Class.new { def self.method_x(&block); block.call if block_given? ; end }
66
+ method = ClassMethod.new(klass, :method_x)
67
+
68
+ method.hide_original_method
69
+ method.define_new_method
70
+ method.remove_new_method
71
+ method.restore_original_method
72
+
73
+ block_called = false
74
+ klass.method_x { block_called = true }
75
+ assert block_called
76
+ end
77
+
64
78
  def test_should_not_restore_original_method_if_none_was_defined_in_first_place
65
79
  klass = Class.new { def self.method_x; :new_result; end }
66
80
  method = ClassMethod.new(klass, :method_x)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-19 00:00:00.000000000 Z
12
+ date: 2012-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: metaclass
16
- requirement: &70343855815280 !ruby/object:Gem::Requirement
16
+ requirement: &70286755904100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70343855815280
24
+ version_requirements: *70286755904100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70343855813960 !ruby/object:Gem::Requirement
27
+ requirement: &70286755902780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70343855813960
35
+ version_requirements: *70286755902780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: introspection
38
- requirement: &70343855813500 !ruby/object:Gem::Requirement
38
+ requirement: &70286755902320 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.0.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70343855813500
46
+ version_requirements: *70286755902320
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &70343855813120 !ruby/object:Gem::Requirement
49
+ requirement: &70286755901940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70343855813120
57
+ version_requirements: *70286755901940
58
58
  description: Mocking and stubbing library with JMock/SchMock syntax, which allows
59
59
  mocking and stubbing of methods on real (non-mock) classes.
60
60
  email: mocha-developer@googlegroups.com
@@ -273,6 +273,7 @@ files:
273
273
  - test/acceptance/stubba_test_result_test.rb
274
274
  - test/acceptance/stubbing_error_backtrace_test.rb
275
275
  - test/acceptance/stubbing_frozen_object_test.rb
276
+ - test/acceptance/stubbing_method_accepting_block_parameter_test.rb
276
277
  - test/acceptance/stubbing_method_unnecessarily_test.rb
277
278
  - test/acceptance/stubbing_nil_test.rb
278
279
  - test/acceptance/stubbing_non_existent_any_instance_method_test.rb
@@ -359,7 +360,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
359
360
  version: '0'
360
361
  segments:
361
362
  - 0
362
- hash: 1290928967104068171
363
+ hash: -4562673917172409454
363
364
  required_rubygems_version: !ruby/object:Gem::Requirement
364
365
  none: false
365
366
  requirements: