From 0947d5d9ba4f8c9259ec71641384536ad6504de1 Mon Sep 17 00:00:00 2001 From: James Mead Date: Mon, 25 Apr 2022 15:34:03 +0100 Subject: [PATCH] [skip ci] Update documentation for v1.14.0 release --- docs/Mocha.html | 6 +- docs/Mocha/API.html | 6 +- docs/Mocha/ClassMethods.html | 6 +- docs/Mocha/Configuration.html | 6 +- docs/Mocha/Expectation.html | 6 +- docs/Mocha/ExpectationError.html | 6 +- docs/Mocha/ExpectationErrorFactory.html | 6 +- docs/Mocha/Hooks.html | 6 +- docs/Mocha/Integration.html | 6 +- docs/Mocha/Integration/MiniTest.html | 6 +- docs/Mocha/Integration/MiniTest/Adapter.html | 6 +- docs/Mocha/Integration/TestUnit.html | 6 +- docs/Mocha/Integration/TestUnit/Adapter.html | 6 +- docs/Mocha/Mock.html | 66 +- docs/Mocha/ObjectMethods.html | 6 +- docs/Mocha/ParameterMatchers.html | 6 +- docs/Mocha/ParameterMatchers/AllOf.html | 6 +- docs/Mocha/ParameterMatchers/AnyOf.html | 6 +- .../ParameterMatchers/AnyParameters.html | 6 +- docs/Mocha/ParameterMatchers/Anything.html | 6 +- docs/Mocha/ParameterMatchers/Base.html | 6 +- docs/Mocha/ParameterMatchers/Equals.html | 6 +- .../ParameterMatchers/EquivalentUri.html | 6 +- docs/Mocha/ParameterMatchers/HasEntries.html | 6 +- docs/Mocha/ParameterMatchers/HasEntry.html | 6 +- docs/Mocha/ParameterMatchers/HasKey.html | 6 +- docs/Mocha/ParameterMatchers/HasKeys.html | 6 +- docs/Mocha/ParameterMatchers/HasValue.html | 6 +- docs/Mocha/ParameterMatchers/Includes.html | 6 +- docs/Mocha/ParameterMatchers/InstanceOf.html | 6 +- docs/Mocha/ParameterMatchers/IsA.html | 6 +- docs/Mocha/ParameterMatchers/KindOf.html | 6 +- docs/Mocha/ParameterMatchers/Not.html | 6 +- docs/Mocha/ParameterMatchers/Optionally.html | 6 +- .../ParameterMatchers/RegexpMatches.html | 6 +- .../Mocha/ParameterMatchers/RespondsWith.html | 6 +- .../ParameterMatchers/YamlEquivalent.html | 6 +- docs/Mocha/Sequence.html | 6 +- docs/Mocha/StateMachine.html | 6 +- docs/Mocha/StateMachine/State.html | 6 +- docs/Mocha/StateMachine/StatePredicate.html | 6 +- docs/Mocha/StubbingError.html | 6 +- docs/_index.html | 8 +- docs/css/style.css | 1 + docs/file.COPYING.html | 9 +- docs/file.MIT-LICENSE.html | 13 +- docs/file.README.html | 232 +- docs/file.RELEASE.html | 2226 ++++++++--------- docs/frames.html | 2 +- docs/index.html | 232 +- docs/top-level-namespace.html | 6 +- 51 files changed, 1413 insertions(+), 1628 deletions(-) diff --git a/docs/Mocha.html b/docs/Mocha.html index 1bb39f3ab..f1072aede 100644 --- a/docs/Mocha.html +++ b/docs/Mocha.html @@ -6,7 +6,7 @@ Module: Mocha - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -244,9 +244,9 @@

diff --git a/docs/Mocha/API.html b/docs/Mocha/API.html index caf3b440c..5004382c8 100644 --- a/docs/Mocha/API.html +++ b/docs/Mocha/API.html @@ -6,7 +6,7 @@ Module: Mocha::API - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -1275,9 +1275,9 @@

diff --git a/docs/Mocha/ClassMethods.html b/docs/Mocha/ClassMethods.html index ade89c82d..3facee345 100644 --- a/docs/Mocha/ClassMethods.html +++ b/docs/Mocha/ClassMethods.html @@ -6,7 +6,7 @@ Module: Mocha::ClassMethods - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -254,9 +254,9 @@

diff --git a/docs/Mocha/Configuration.html b/docs/Mocha/Configuration.html index de3caf320..f4cfb4737 100644 --- a/docs/Mocha/Configuration.html +++ b/docs/Mocha/Configuration.html @@ -6,7 +6,7 @@ Class: Mocha::Configuration - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -1515,9 +1515,9 @@

diff --git a/docs/Mocha/Expectation.html b/docs/Mocha/Expectation.html index c95e09c3d..ea47f7c3a 100644 --- a/docs/Mocha/Expectation.html +++ b/docs/Mocha/Expectation.html @@ -6,7 +6,7 @@ Class: Mocha::Expectation - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -2847,9 +2847,9 @@

diff --git a/docs/Mocha/ExpectationError.html b/docs/Mocha/ExpectationError.html index 2f36d2d9b..e39acbd64 100644 --- a/docs/Mocha/ExpectationError.html +++ b/docs/Mocha/ExpectationError.html @@ -6,7 +6,7 @@ Exception: Mocha::ExpectationError - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -142,9 +142,9 @@

Overview

diff --git a/docs/Mocha/ExpectationErrorFactory.html b/docs/Mocha/ExpectationErrorFactory.html index 20d216ab7..b40b51ffb 100644 --- a/docs/Mocha/ExpectationErrorFactory.html +++ b/docs/Mocha/ExpectationErrorFactory.html @@ -6,7 +6,7 @@ Class: Mocha::ExpectationErrorFactory - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -250,9 +250,9 @@

diff --git a/docs/Mocha/Hooks.html b/docs/Mocha/Hooks.html index fb635b124..24928c8ee 100644 --- a/docs/Mocha/Hooks.html +++ b/docs/Mocha/Hooks.html @@ -6,7 +6,7 @@ Module: Mocha::Hooks - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -360,9 +360,9 @@

diff --git a/docs/Mocha/Integration.html b/docs/Mocha/Integration.html index b14d94565..17f2ac958 100644 --- a/docs/Mocha/Integration.html +++ b/docs/Mocha/Integration.html @@ -6,7 +6,7 @@ Module: Mocha::Integration - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -115,9 +115,9 @@

Defined Under Namespace

diff --git a/docs/Mocha/Integration/MiniTest.html b/docs/Mocha/Integration/MiniTest.html index ef4201b32..b1f79d705 100644 --- a/docs/Mocha/Integration/MiniTest.html +++ b/docs/Mocha/Integration/MiniTest.html @@ -6,7 +6,7 @@ Module: Mocha::Integration::MiniTest - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -113,9 +113,9 @@

Defined Under Namespace

diff --git a/docs/Mocha/Integration/MiniTest/Adapter.html b/docs/Mocha/Integration/MiniTest/Adapter.html index a0997eeaf..937287297 100644 --- a/docs/Mocha/Integration/MiniTest/Adapter.html +++ b/docs/Mocha/Integration/MiniTest/Adapter.html @@ -6,7 +6,7 @@ Module: Mocha::Integration::MiniTest::Adapter - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -154,9 +154,9 @@

Methods included from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/Integration/TestUnit.html b/docs/Mocha/Integration/TestUnit.html index 006f3614e..121920db9 100644 --- a/docs/Mocha/Integration/TestUnit.html +++ b/docs/Mocha/Integration/TestUnit.html @@ -6,7 +6,7 @@ Module: Mocha::Integration::TestUnit - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -113,9 +113,9 @@

Defined Under Namespace

diff --git a/docs/Mocha/Integration/TestUnit/Adapter.html b/docs/Mocha/Integration/TestUnit/Adapter.html index f945563d4..6b74c7a7a 100644 --- a/docs/Mocha/Integration/TestUnit/Adapter.html +++ b/docs/Mocha/Integration/TestUnit/Adapter.html @@ -6,7 +6,7 @@ Module: Mocha::Integration::TestUnit::Adapter - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -154,9 +154,9 @@

Methods included from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/Mock.html b/docs/Mocha/Mock.html index ebaa86d90..f3478cdef 100644 --- a/docs/Mocha/Mock.html +++ b/docs/Mocha/Mock.html @@ -6,7 +6,7 @@ Class: Mocha::Mock - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -318,19 +318,19 @@

 
 
-309
-310
-311
-312
 313
 314
 315
 316
 317
-318
+318 +319 +320 +321 +322 -
# File 'lib/mocha/mock.rb', line 309
+      
# File 'lib/mocha/mock.rb', line 313
 
 def method_missing(symbol, *arguments, &block) # rubocop:disable Style/MethodMissingSuper
   check_expiry
@@ -537,12 +537,15 @@ 

117 118 119 -120

+120 +121 +122
# File 'lib/mocha/mock.rb', line 111
 
 def expects(method_name_or_hash, backtrace = nil)
+  expectation = nil
   iterator = ArgumentIterator.new(method_name_or_hash)
   iterator.each do |*args|
     method_name = args.shift
@@ -551,6 +554,7 @@ 

expectation.returns(args.shift) unless args.empty? @expectations.add(expectation) end + expectation end

@@ -693,13 +697,13 @@

 
 
-232
-233
-234
-235
+236 +237 +238 +239 -
# File 'lib/mocha/mock.rb', line 232
+      
# File 'lib/mocha/mock.rb', line 236
 
 def responds_like(responder)
   @responder = responder
@@ -817,12 +821,12 @@ 

 
 
-265
-266
-267
+269 +270 +271

-
# File 'lib/mocha/mock.rb', line 265
+      
# File 'lib/mocha/mock.rb', line 269
 
 def responds_like_instance_of(responder_class)
   responds_like(responder_class.allocate)
@@ -989,8 +993,6 @@ 

 
 
-147
-148
 149
 150
 151
@@ -999,12 +1001,17 @@ 

154 155 156 -157

+157 +158 +159 +160 +161

-
# File 'lib/mocha/mock.rb', line 147
+      
# File 'lib/mocha/mock.rb', line 149
 
 def stubs(method_name_or_hash, backtrace = nil)
+  expectation = nil
   iterator = ArgumentIterator.new(method_name_or_hash)
   iterator.each do |*args|
     method_name = args.shift
@@ -1014,6 +1021,7 @@ 

expectation.returns(args.shift) unless args.empty? @expectations.add(expectation) end + expectation end

@@ -1094,14 +1102,14 @@

 
 
-177
-178
-179
-180
-181
+181 +182 +183 +184 +185

-
# File 'lib/mocha/mock.rb', line 177
+      
# File 'lib/mocha/mock.rb', line 181
 
 def unstub(*method_names)
   method_names.each do |method_name|
@@ -1126,9 +1134,9 @@ 

diff --git a/docs/Mocha/ObjectMethods.html b/docs/Mocha/ObjectMethods.html index 2c9384eab..bae7269a9 100644 --- a/docs/Mocha/ObjectMethods.html +++ b/docs/Mocha/ObjectMethods.html @@ -6,7 +6,7 @@ Module: Mocha::ObjectMethods - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -755,9 +755,9 @@

diff --git a/docs/Mocha/ParameterMatchers.html b/docs/Mocha/ParameterMatchers.html index 2e0d23b2e..9bd6f9887 100644 --- a/docs/Mocha/ParameterMatchers.html +++ b/docs/Mocha/ParameterMatchers.html @@ -6,7 +6,7 @@ Module: Mocha::ParameterMatchers - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -3054,9 +3054,9 @@

diff --git a/docs/Mocha/ParameterMatchers/AllOf.html b/docs/Mocha/ParameterMatchers/AllOf.html index 361db405d..2e13e26ce 100644 --- a/docs/Mocha/ParameterMatchers/AllOf.html +++ b/docs/Mocha/ParameterMatchers/AllOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::AllOf - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/AnyOf.html b/docs/Mocha/ParameterMatchers/AnyOf.html index 232eff20d..1eb8d7998 100644 --- a/docs/Mocha/ParameterMatchers/AnyOf.html +++ b/docs/Mocha/ParameterMatchers/AnyOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::AnyOf - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/AnyParameters.html b/docs/Mocha/ParameterMatchers/AnyParameters.html index 6b4dbfd81..49751ddef 100644 --- a/docs/Mocha/ParameterMatchers/AnyParameters.html +++ b/docs/Mocha/ParameterMatchers/AnyParameters.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::AnyParameters - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/Anything.html b/docs/Mocha/ParameterMatchers/Anything.html index cd661969a..62190cb1d 100644 --- a/docs/Mocha/ParameterMatchers/Anything.html +++ b/docs/Mocha/ParameterMatchers/Anything.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Anything - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/Base.html b/docs/Mocha/ParameterMatchers/Base.html index 677688bd1..6ef665eb1 100644 --- a/docs/Mocha/ParameterMatchers/Base.html +++ b/docs/Mocha/ParameterMatchers/Base.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Base - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -431,9 +431,9 @@

diff --git a/docs/Mocha/ParameterMatchers/Equals.html b/docs/Mocha/ParameterMatchers/Equals.html index 73aa0d1f2..6f882e23a 100644 --- a/docs/Mocha/ParameterMatchers/Equals.html +++ b/docs/Mocha/ParameterMatchers/Equals.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Equals - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/EquivalentUri.html b/docs/Mocha/ParameterMatchers/EquivalentUri.html index 02b691d3c..d42df8adf 100644 --- a/docs/Mocha/ParameterMatchers/EquivalentUri.html +++ b/docs/Mocha/ParameterMatchers/EquivalentUri.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::EquivalentUri - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/HasEntries.html b/docs/Mocha/ParameterMatchers/HasEntries.html index 62446c126..36608dd6e 100644 --- a/docs/Mocha/ParameterMatchers/HasEntries.html +++ b/docs/Mocha/ParameterMatchers/HasEntries.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasEntries - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/HasEntry.html b/docs/Mocha/ParameterMatchers/HasEntry.html index cbea4c0cb..76cb9212f 100644 --- a/docs/Mocha/ParameterMatchers/HasEntry.html +++ b/docs/Mocha/ParameterMatchers/HasEntry.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasEntry - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/HasKey.html b/docs/Mocha/ParameterMatchers/HasKey.html index bcb45a738..75b368630 100644 --- a/docs/Mocha/ParameterMatchers/HasKey.html +++ b/docs/Mocha/ParameterMatchers/HasKey.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasKey - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/HasKeys.html b/docs/Mocha/ParameterMatchers/HasKeys.html index d5a6829fa..72e996748 100644 --- a/docs/Mocha/ParameterMatchers/HasKeys.html +++ b/docs/Mocha/ParameterMatchers/HasKeys.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasKeys - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/HasValue.html b/docs/Mocha/ParameterMatchers/HasValue.html index b19b35197..70805fa65 100644 --- a/docs/Mocha/ParameterMatchers/HasValue.html +++ b/docs/Mocha/ParameterMatchers/HasValue.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasValue - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/Includes.html b/docs/Mocha/ParameterMatchers/Includes.html index 245de4c06..1ab929693 100644 --- a/docs/Mocha/ParameterMatchers/Includes.html +++ b/docs/Mocha/ParameterMatchers/Includes.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Includes - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/InstanceOf.html b/docs/Mocha/ParameterMatchers/InstanceOf.html index 393b12da5..2ecb893bf 100644 --- a/docs/Mocha/ParameterMatchers/InstanceOf.html +++ b/docs/Mocha/ParameterMatchers/InstanceOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::InstanceOf - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/IsA.html b/docs/Mocha/ParameterMatchers/IsA.html index 33e382345..ca7301b2e 100644 --- a/docs/Mocha/ParameterMatchers/IsA.html +++ b/docs/Mocha/ParameterMatchers/IsA.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::IsA - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/KindOf.html b/docs/Mocha/ParameterMatchers/KindOf.html index 0c6e45b10..f27a0c83d 100644 --- a/docs/Mocha/ParameterMatchers/KindOf.html +++ b/docs/Mocha/ParameterMatchers/KindOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::KindOf - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/Not.html b/docs/Mocha/ParameterMatchers/Not.html index 7f0ed55b5..04722efed 100644 --- a/docs/Mocha/ParameterMatchers/Not.html +++ b/docs/Mocha/ParameterMatchers/Not.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Not - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/Optionally.html b/docs/Mocha/ParameterMatchers/Optionally.html index 42f5b3e6f..9edfdc6eb 100644 --- a/docs/Mocha/ParameterMatchers/Optionally.html +++ b/docs/Mocha/ParameterMatchers/Optionally.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Optionally - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/RegexpMatches.html b/docs/Mocha/ParameterMatchers/RegexpMatches.html index 525a6b796..6571b891a 100644 --- a/docs/Mocha/ParameterMatchers/RegexpMatches.html +++ b/docs/Mocha/ParameterMatchers/RegexpMatches.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::RegexpMatches - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/RespondsWith.html b/docs/Mocha/ParameterMatchers/RespondsWith.html index c851821b8..9f44e59fd 100644 --- a/docs/Mocha/ParameterMatchers/RespondsWith.html +++ b/docs/Mocha/ParameterMatchers/RespondsWith.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::RespondsWith - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/ParameterMatchers/YamlEquivalent.html b/docs/Mocha/ParameterMatchers/YamlEquivalent.html index f9b46908c..00c130975 100644 --- a/docs/Mocha/ParameterMatchers/YamlEquivalent.html +++ b/docs/Mocha/ParameterMatchers/YamlEquivalent.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::YamlEquivalent - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -143,9 +143,9 @@

Methods inherited from - Generated on Fri Jun 25 14:50:43 2021 by + Generated on Mon Apr 25 15:32:08 2022 by yard - 0.9.24 (ruby-2.6.6). + 0.9.27 (ruby-3.0.2). diff --git a/docs/Mocha/Sequence.html b/docs/Mocha/Sequence.html index 6f6c4f7d0..cbbfa02d1 100644 --- a/docs/Mocha/Sequence.html +++ b/docs/Mocha/Sequence.html @@ -6,7 +6,7 @@ Class: Mocha::Sequence - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -139,9 +139,9 @@

Overview

diff --git a/docs/Mocha/StateMachine.html b/docs/Mocha/StateMachine.html index 04ade8711..3ee01d184 100644 --- a/docs/Mocha/StateMachine.html +++ b/docs/Mocha/StateMachine.html @@ -6,7 +6,7 @@ Class: Mocha::StateMachine - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -672,9 +672,9 @@

diff --git a/docs/Mocha/StateMachine/State.html b/docs/Mocha/StateMachine/State.html index 4d5809870..61f346ab0 100644 --- a/docs/Mocha/StateMachine/State.html +++ b/docs/Mocha/StateMachine/State.html @@ -6,7 +6,7 @@ Class: Mocha::StateMachine::State - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -138,9 +138,9 @@

Overview

diff --git a/docs/Mocha/StateMachine/StatePredicate.html b/docs/Mocha/StateMachine/StatePredicate.html index fb72b9bfa..03c667ac2 100644 --- a/docs/Mocha/StateMachine/StatePredicate.html +++ b/docs/Mocha/StateMachine/StatePredicate.html @@ -6,7 +6,7 @@ Class: Mocha::StateMachine::StatePredicate - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -134,9 +134,9 @@

Direct Known Subclasses

diff --git a/docs/Mocha/StubbingError.html b/docs/Mocha/StubbingError.html index 8a00819b1..5bca096d6 100644 --- a/docs/Mocha/StubbingError.html +++ b/docs/Mocha/StubbingError.html @@ -6,7 +6,7 @@ Class: Mocha::StubbingError - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -140,9 +140,9 @@

Overview

diff --git a/docs/_index.html b/docs/_index.html index d5eb52ce2..9ccf65030 100644 --- a/docs/_index.html +++ b/docs/_index.html @@ -4,7 +4,7 @@ - Mocha 1.13.0 + Mocha 1.14.0 @@ -52,7 +52,7 @@
-

Mocha 1.13.0

+

Mocha 1.14.0

Alphabetic Index

@@ -516,9 +516,9 @@

Namespace Listing A-Z

diff --git a/docs/css/style.css b/docs/css/style.css index 62f4349d3..eb0dbc86f 100644 --- a/docs/css/style.css +++ b/docs/css/style.css @@ -52,6 +52,7 @@ body { background: #fff; padding: 1.2em; padding-top: 0.2em; + box-sizing: border-box; } @media (max-width: 920px) { diff --git a/docs/file.COPYING.html b/docs/file.COPYING.html index 2291ac658..c98f6a278 100644 --- a/docs/file.COPYING.html +++ b/docs/file.COPYING.html @@ -6,7 +6,7 @@ File: COPYING - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -57,8 +57,7 @@
-
-

Copyright Revieworld Ltd. 2006

+

Copyright Revieworld Ltd. 2006

You may use, copy and redistribute this library under the same terms as Ruby itself or under the MIT license.

@@ -72,9 +71,9 @@
diff --git a/docs/file.MIT-LICENSE.html b/docs/file.MIT-LICENSE.html index f4580dbcd..99e16b381 100644 --- a/docs/file.MIT-LICENSE.html +++ b/docs/file.MIT-LICENSE.html @@ -6,7 +6,7 @@ File: MIT-LICENSE - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -57,14 +57,13 @@
-
-

Copyright © 2006 Revieworld Ltd.

+

Copyright (c) 2006 Revieworld Ltd.

-

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@@ -454,9 +438,9 @@

License

diff --git a/docs/file.RELEASE.html b/docs/file.RELEASE.html index 157e41a83..2c902485b 100644 --- a/docs/file.RELEASE.html +++ b/docs/file.RELEASE.html @@ -6,7 +6,7 @@ File: RELEASE - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -57,1220 +57,1030 @@
-
-

Release Notes

- -

1.13.0

- -

External changes

-
  • -

    Add ParameterMatchers#has_keys - thanks to @cstyles for #512 (18d8104)

    -
  • -

    Fix misleading exception message in ParameterMatchers#has_entry - thanks to @cstyles for #513 (9c4ef13)

    -
  • -

    Only add dependency on rubocop if we're actually going to use it (f2f879f)

    -
  • -

    Fix rake dependency constraints for older Ruby versions (7ce5f29)

    -
- -

Internal changes

-
  • -

    Check documentation can be generated as part of CircleCI build (b30d9a9)

    -
  • -

    Add –fail-on-warning option to yard rake task (53a6ee3)

    -
  • -

    Add a weekly scheduled build to the CircleCI build (fd2a4c6)

    -
  • -

    Add Ruby v1.8 to the CircleCI build matrix (818ca03)

    -
  • -

    Add API token to fix CircleCI badge in README (607c5aa)

    -
  • -

    Provide wrapped option for #mocha_inspect on hashes & arrays (d8f44bc)

    -
  • -

    Use CircleCI instead of TravisCI for automated builds (c98c6ec)

    -
  • -

    Switch to newer default Travis CI build env (c78f75c)

    -
  • -

    Use latest Ruby versions in Travis CI builds (9e0043a)

    -
  • -

    Use latest JRuby v9.2.18 in Travis CI builds (8c99a1b)

    -
  • -

    Use consistent JRuby versions in Travis CI builds (0f849aa)

    -
  • -

    Use more recent version of JRuby in Travis CI build matrix (58653db)

    -
- -

1.12.0

- -

External changes

-
  • -

    Various improvements to README inspired by #207 and #390 - thanks to @nitishr for his work on #390 (fed0eee6)

    -
  • -

    Improve documentation related to StateMachine classes - thanks to @nitishr (#425 & #427)

    -
  • -

    Fix regression in cardinality introduced in v1.10.0 (59454a8) and reported in #473 - thanks to @srvance for reporting and @nitishr for fixing (#474)

    -
  • -

    Fix documentation for Mocha::Expectation#when - thanks to @olleolleolle (b4f59daa & #477)

    -
  • -

    Remove Mocha::Mock#respond_to? from documentation - thanks to @nitishr (#480)

    -
  • -

    Improvements to documentation for Expectation#yields & #multiple_yields - thanks to @andyw8 for reporting in #495 (1b6571c)

    -
  • -

    Remove documentation & tests from gem to reduce its size by over 50% - thanks to @gabetax (#500)

    -
  • -

    Update documentation to point to travis-ci.com instead of travis-ci.org

    -
- -

Internal changes

-
  • -

    Refactor StateMachine-related classes - thanks to @nitishr (#425 & #427)

    -
  • -

    Remove redundant test - thanks to @nitishr (8e4f1a7c)

    -
  • -

    Add Ruby 2.7 to Travis CI matrix - thanks to @bastelfreak (fc5ea2f2)

    -
  • -

    Simplify Mockery - thanks to @nitishr (#449)

    -
  • -

    Update Travis CI badge to point to main vs master branch (bd8028f8)

    -
  • -

    Generate docs using newer version of yard (v0.9.25) (c619afac)

    -
  • -

    Manually upgrade jquery in docs from v1.7.1 -> v1.9.0 to fix CVE-2017-16011 (211098a5, dd5eeedb & 1b76e4d5; also see #492)

    -
  • -

    Remove reference to non-existent jquery source map to fix error in Chrome developer tools (20156555)

    -
  • -

    Temporarily ignore Ruby v1.8.7 build failures (e5b9feef)

    -
- -

1.11.2

- -

External changes

-
  • -

    Fix regression introduced in v1.10.0 that meant Object#inspect was called unnecessarily (368abd98)

    -
  • -

    Warn when mock object receives invocations in another test - thanks to @nitishr (#442)

    -
  • -

    Avoid rubocop comments appearing in YARD-generated docs (d8019eed)

    -
- -

Internal changes

-
  • -

    Replace StubbedMethod#original_method & #original_visibility attribute reader methods with instance variables - thanks to @nitishr (d917f332)

    -
  • -

    Set up MochaExampleTest & StubbaExampleTest as acceptance tests - thanks to @nitishr (4881cc58)

    -
  • -

    Delete unused PrettyParameters class - thanks to @nitishr (314ea922)

    -
- -

1.11.1

- -

External changes

-
  • -

    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)

    -
- -

1.11.0

- -

External changes

-
  • -

    Add Expectation#with_block_given & Expectation#with_no_block_given (#441).

    -
  • -

    Allows non-deprecated solution for #382. Thanks to @yemartin for reporting and to @techbelly & @nitishr for feedback.

    -
  • -

    Fix issue with non-Array arguments passed to Expectation#multiple_yields (#444).

    -
  • -

    The undocumented behaviour is now properly supported and documented.

    -
- -

Internal changes

-
  • -

    Move static YARD options from Rake task to .yardopts file - thanks to @nitishr (#429)

    -
  • -

    Simplify implementation of yielding functionality - thanks to @nitishr (#439)

    -
  • -

    Add missing require statement to acceptance_test_helper.rb (1070fc02)

    -
  • -

    Add some baseline acceptance tests for yielding behaviour (c2cac911)

    -
  • -

    Display a sponsor button on GitHub repo page (9fc5911b)

    -
  • -

    Use new Deprecation.warning behaviour in Invocation#call (932d1166)

    -
- -

1.10.2

-
  • -

    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):

    -
  • -

    The behaviour of API#mock, API#stub and API#stub_everything when called with a symbol as the first argument.

    -
  • -

    The behaviour of Expectation#yields and Expectation#multiple_yields when the stubbed method is called without a block.

    -
- -

1.10.1

-
  • -

    Ensure ObjectMethods & ClassMethods included when API extended (43778756)

    -
  • -

    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)

    -
- -

1.10.0

-
  • -

    Improve deprecation warning when requiring 'mocha/setup' (388f44d7)

    -
  • -

    Add documentation for Cucumber integration (13ab797b)

    -
  • -

    Add documentation about an undocumented feature of API#mock, API#stub & API#stub_everything being changed (7ed2e4e7, d30c1717)

    -
- -

1.10.0.beta.1

-
  • -

    Hide ClassMethods#method_visibility & #method_exists? methods to avoid clash with Rails (#428)

    -
- -

1.10.0.alpha

- -

External changes

-
  • -

    Remove dependency on metaclass gem (#49, #365)

    -
  • -

    Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377)

    -
  • -

    More realistic examples in documentation for Expectation#yields and #multiple_yields - thanks to @nitishr (#352, #383)

    -
  • -

    Improve documentation for Mock#responds_like & #responds_like_instance_of - thanks to @nitishr (#337, #384)

    -
  • -

    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)

    -
  • -

    Document MOCHA_OPTIONS in README - thanks to @nitishr (#311, #386)

    -
  • -

    Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385)

    -
  • -

    Deprecation warning if integration using 'mocha/test_unit' or 'mocha/minitest' fails - thanks to @nitishr (#229, #389, c6032d0b)

    -
  • -

    Require at least one specified sequence for Expectation#in_sequence - thanks to @nitishr (#79, #396, 9020248a)

    -
  • -

    Make signatures of Mock#unstub & ObjectMethods#unstub consistent - thanks to @nitishr (#397, f04d437)

    -
  • -

    Deprecate requiring 'mocha/setup' (36adf880)

    -
  • -

    Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410)

    -
  • -

    Put deprecations into effect (#400, #418):

    -
  • -

    Remove deprecated 'mocha_standalone.rb' & 'mocha/standalone.rb'

    -
  • -

    Fail fast if no test library loaded

    -
  • -

    Removed optional block for Mocha::API#mock, #stub & #stub_everything

    -
  • -

    Remove deprecated ParameterMatchers#has_equivalent_query_string method

    -
  • -

    Remove deprecated 'mocha/mini_test.rb'

    -
  • -

    Fix typo in docs for Mocha::Configuration.prevent (266ce71c)

    -
  • -

    New-style configuration (see documentation for Mocha::Configuration) (#407, #421)

    -
  • -

    Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d)

    -
  • -

    Deprecate support for versions of test-unit & minitest which need monkey-patching (a34e1a88)

    -
  • -

    Deprecate old-style Rails plugin (#403, 2df77134)

    -
  • -

    Documentation fixes & improvements which also fix YARD warnings (472d5416, a2c0d64a)

    -
- -

Internal changes

-
  • -

    Pin minitest to v5.11.3 for Ruby v1.8.7 to fix build; minitest no longer supports Ruby v1.8.7 (4a0a580)

    -
  • -

    Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f)

    -
  • -

    Only run rubocop for MRI Ruby versions & non-integration test builds (8f1c6af)

    -
  • -

    Reduce duplication in any instance method class - thanks to @nitishr (#378)

    -
  • -

    Simplify AnyInstanceMethod, ClassMethod, InstanceMethod, ModuleMethod class hierarchy - thanks to @nitishr (#381)

    -
  • -

    Simplify ClassMethods#method_exists? & ObjectMethods#method_exists? making them consistent - thanks to @nitishr (#270, #362, #370)

    -
  • -

    Don't override definition of singleton_class in ClassMethods - thanks to @nitishr (#391, #392)

    -
  • -

    Do not include 'method_definer' methods into all objects (#268, #402)

    -
  • -

    Distinguish different ObjectMethods modules (#268, #404)

    -
  • -

    Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411)

    -
  • -

    Consistently use assert_raises - thanks to @nitishr (#405, #412, a66b7bed)

    -
  • -

    Update Ruby & JRuby versions in Travis CI config (18cb1a93, eb061c53)

    -
  • -

    Rubocop improvements (aa16ea67…6f4db70b, 2a1240e6…e95716ae)

    -
  • -

    Fix inconsistency in CardinalityTest (aa10e0a8)

    -
  • -

    Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535)

    -
  • -

    Remove default argument in Expectation#invoke - thanks to @nitishr (#414, #420)

    -
- -

1.9.0

-
  • -

    Add TruffleRuby to Travis CI build matrix - thanks to @deepj (#354)

    -
  • -

    Explicitly set Travis CI OS to Ubuntu Trusty 14.04 (ded1fa45)

    -
  • -

    Expand explanation of thread-safety concerns - thanks to @techbelly (#357)

    -
  • -

    Refactor class method and any instance method - thanks to @chrisroos (#358)

    -
  • -

    Rely on default bundler version in Travis CI builds (3352e9c5)

    -
  • -

    Fix local build-matrix script (11abe231)

    -
  • -

    No need to install latest bundler in build-matrix script (8247a894)

    -
- -

1.8.0

-
  • -

    Constrain rubocop version to avoid breaking Travis CI builds (05e507f5)

    -
  • -

    Avoid calling Kernel#format from ObjectMethods#mocha_inspect - thanks to @hoffmanilya (#345)

    -
  • -

    Fix build matrix script (#346)

    -
  • -

    Avoid deprecation warning in gemspec (4976e0bc)

    -
  • -

    Removed link to documentation translation (ef428ea2)

    -
  • -

    Don't use the new bundler v2 in builds (683ded9b)

    -
  • -

    Moved documentation from gofreerange.com/mocha/docs to mocha.jamesmead.org/ 683ded…a17fde

    -
- -

1.7.0

-
  • -

    Update Ruby & JRuby versions in Travis CI config (9bf55631 & 3883af7e)

    -
  • -

    Simplify gemspec (63744f86)

    -
  • -

    Add rubocop and fix most cop violations (#341)

    -
  • -

    Use Kernel#warn for deprecations - thanks to @etiennebarrie (#333, 196970a)

    -
- -

1.6.0

-
  • -

    Fix subtle bug in setting correct visibility of stubbed module methods on Kernel or Object - thanks to @chrisroos (#295)

    -
  • -

    Avoid mocks for partial mocking leaking into subsequent tests - thanks to @skliew for reporting (#331)

    -
  • -

    Remove OpenCollective badge, backers & sponsors (a283a079)

    -
  • -

    Change gem version badge to SVG format and add SemVer stability badge - thanks to @greysteil (#335)

    -
  • -

    Improve documentation for Configuration (#236)

    -
- -

1.5.0

-
  • -

    Prevent use of Mocha outside the context of a test/example - thanks to @andyw8 & @lzap (#327)

    -
- -

1.4.0

-
  • -

    Fix deprecation warning for assert_nil in ClassMethodTest (#308 & #309)

    -
  • -

    Display file and line number in deprecation warning - thanks to @chrisarcand (#310, #312 & #313)

    -
  • -

    Rename mocha/mini_test.rb to mocha/minitest.rb - thanks to @grosser (#320 & #322)

    -
  • -

    Fix warning when delegating to mock in Ruby 2.4 - thanks to @tjvc (#321 & #323)

    -
  • -

    Updates to Travis CI configuration (73af600..9732726 & 0426e5e)

    -
- -

1.3.0

-
  • -

    Ensure all tests run individually - thanks to @chrisroos (#267)

    -
  • -

    Update Travis CI build status badge to show master branch status (#264)

    -
  • -

    Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)

    -
  • -

    Fix pretty printing of quotes in String#mocha_inspect (#215 & #223)

    -
  • -

    Add release instructions to README - thanks to @chrisroos (70a5febd & 3c664df7)

    -
  • -

    Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)

    -
  • -

    Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos (8f58eddf)

    -
  • -

    Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 & eca7560c)

    -
  • -

    Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)

    -
  • -

    Add latest stable version of JRuby to Travis CI build matrix (#288)

    -
  • -

    Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)

    -
  • -

    Deprecate passing block to mock object constructor (#290)

    -
  • -

    Add a known issue to README for Ruby bug 12876 (#276)

    -
  • -

    Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga (#297)

    -
  • -

    Fix Mocha::ParameterMatchers#includes for Array values - thanks to @timcraft (#302)

    -
  • -

    Use faster container-based virtual environments for Travis CI builds (#305)

    -
  • -

    Rename Mocha::ParameterMatchers::QueryStringMatches to QueryString (#306)

    -
  • -

    Handle blank parameter value for query string matcher - thanks to @weynsee (#303 & #304)

    -
  • -

    Rename Mocha::ParameterMatchers::QueryString -> EquivalentUri (#307)

    -
  • -

    Use do ... end instead of { ... } in acceptance tests - thanks to @chrisroos (#294)

    -
- -

1.2.1

-
  • -

    Fixed #272. Workaround Ruby bug 12832 which caused interpreter to hang. See bugs.ruby-lang.org/issues/12832. Thanks to @chrisroos & @petems (6f1c8b9b, #273).

    -
- -

1.2.0

-
  • -

    Always use prepended module to stub class & instance methods for Ruby v2+ - thanks to @grosser & @chrisroos (43d56671, #244)

    -
  • -

    Always use prepended module to stub AnyInstance methods in Ruby v2+ - thanks to @chrisroos (#262)

    -
  • -

    Always set visibility of stub method to match stubbed method on included module - thanks to @grosser & @chrisroos (e87c03b0, #248)

    -
  • -

    Always set visibility to stub method to match stubbed method on superclass - thanks to @chrisroos (38d902ad)

    -
  • -

    Allow stubbing of method to which any instance responds (#200)

    -
  • -

    Allow includes matcher to take matcher arguments - thanks to @lazyatom (#217)

    -
  • -

    Avoid exception in older version of Rubygems - thanks to @chrisroos (78d930a7)

    -
  • -

    Add licenses to gemspec as requested by @coreyhaines (#201)

    -
  • -

    Fix typo in README - thanks to @jaredbeck (6119460d)

    -
  • -

    Added section about using Mocha with RSpec & Rails to README (#221)

    -
  • -

    Fix documentation for Mocha::API#stub method - thanks to @raeno (599b1dcd)

    -
  • -

    Added backers and sponsors from OpenCollective - thanks to @piamancini (#253)

    -
  • -

    Fix typo in docs for equals - thanks to @alexcoco (#254)

    -
  • -

    Add known issue for Ruby v1.8 to README - thanks to @chrisroos (2c642096)

    -
- -

1.1.0

-
  • -

    Set visibility of any instance stub method.

    -
  • -

    Stub methods with a prepended method if there are other prepended methods. Thanks to @mrsimo.

    -
  • -

    Improve docs for Mock#responds_like & #responds_like_instance_of.

    -
  • -

    Use GitHub convention for instructions on contributing to Mocha.

    -
  • -

    Fix typos in docs. Thanks to @10io

    -
- -

1.0.0

- -

External changes

-
  • -

    Assume 'mocha' has been required when requiring 'mocha/setup'.

    -
  • -

    Provide shortcuts for integrating with specific test library i.e. require 'mocha/test_unit' or require 'mocha/mini_test' as alternatives to require 'mocha/setup'.

    -
  • -

    Do not automatically try to integrate with test libraries. Since the automatic test library integration functionality requires the test library to be loaded and this doesn't usually happen until after the bundle is loaded, it makes things simpler if we use require 'mocha/setup' to explicitly setup Mocha when we know the test library has been loaded. Fixes #146 & #155.

    -
  • -

    Consider stubs on superclasses if none exist on primary receiver. Largely based on changes suggested by @ccutrer in #145. Note: this may break existing tests which rely on the old behaviour. Stubbing a superclass method and then invoking that method on a child class would previously cause an unexpected invocation error. By searching up through the inheritance hierarchy for each of the delegate mock objects, we can provide more intuitive behaviour. Instead of an unexpected invocation error, invoking the method on the child class will cause the stubbed method on the superclass to be used.

    -
  • -

    Avoid recursion when constructing unexpected invocation message. Fixes #168.

    -
  • -

    Add explanation of method dispatch. Heavily based on the relevant jMock v1 documentation. Fixes #172.

    -
  • -

    Make class_eval line number more accurate. This sets the line number as the line number of the def statement. Closes #169.

    -
  • -

    Allow nesting of responds_with parameter matcher. Closes #166.

    -
  • -

    Define Mocha module before it's referenced. The test helper defines a class TestCase within the Mocha module. When 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.

    -
  • -

    Document lack of thread-safety. Fixes #154.

    -
  • -

    Document how to use the build-matrix script. Fixes #160.

    -
  • -

    Stubbing non-public method should use same visibility. This will probably break some existing tests that were somehow relying on the stubbed method being public while the original method was protected or private. Fixes #150.

    -
- -

Internal changes

-
  • -

    Use lastest Rubygems in Travis CI builds.

    -
  • -

    Run the standard test suite against Ruby 2.1.0 in the build matrix.

    -
  • -

    Run integration tests against Ruby 2.0.0 with latest Test::Unit gem in the build matrix.

    -
  • -

    Test::Unit is not available in Ruby v1.9.3 standard library, so remove it from the build matrix.

    -
  • -

    Force use of Test::Unit runner, etc in relevant integration tests. Prior to this, I don't think we were really testing the Mocha integration with Test::Unit much, because, although TestUnitTest was a subclass of Test::Unit::TestCase, the important test case instances are the temporary ones built by TestRunner#run_as_test et al. Prior to this change, these would only have used Test::Unit where MiniTest was not available at all i.e. only in early versions of Ruby and when the MiniTest gem was not loaded.

    -
  • -

    Reset environment variables between build matrix builds.

    -
  • -

    Only activate integration with relevant test library for each of the integration tests.

    -
  • -

    Include standard build combinations from Travis CI config i.e. builds using standard library versions of test libraries.

    -
  • -

    Fix build-matrix.rb script. Also use .travis.yml to decide what combinations to run. This means we can now simulate the Travis CI build locally and avoid duplication. Fixes #157.

    -
  • -

    Remove Ruby version map from build matrix script. I'm using the rbenv-aliases plugin to alias minor versions to the relevant patch version.

    -
- -

0.14.0

-
  • -

    Official support for MiniTest v5. All tests now pass on the continuous integration build.

    -
- -

0.14.0.alpha

-
  • -

    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.

    -
  • -

    Documentation updates.

    -
- -

0.13.3

-
  • -

    Allow Mocha::ParameterMatchers#includes to accept multiple items. Thanks to @simao.

    -
  • -

    Allow stubbing of private Kernel methods. Fixes #134. Thanks to @camski for reporting.

    -
  • -

    Avoid a warning when test/unit/version is required by other libraries in the same project. Fixes #140. Thanks to @tmiller.

    -
  • -

    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.

    -
  • -

    Safer restoration of stubbed method visibility. Fixes #141. Thanks to @tmm1.

    -
  • -

    Ensure Mockery instance gets reset even if exception raised. Fixes #144.

    -
  • -

    Adapt Mocha acceptance tests to cope with changes in output from latest (v4.6.2) of MiniTest.

    -
  • -

    Updates to README about Rails compatibility.

    -
- -

0.13.2

-
  • -

    Stubbing of methods re-declared with different visibilty. Fixes #109.

    -
  • -

    Add Mock#responds_like_instance_of. Fixes #119.

    -
  • -

    Make Expectation#inspect less verbose and more useful. Fixes #122.

    -
  • -

    Make unit tests more robust to changes in environment. Fixes #121.

    -
  • -

    Update README in an attempt to head Rails-related issues off at the pass.

    -
  • -

    Add a Gem Badge to provide a link to Mocha on Rubygems.

    -
  • -

    Make documentation example consistent with other examples.

    -
- -

0.13.1

-
  • -

    Fix #97 - Mocha::ParameterMatchers#has_entry does not work with an Array as the entry's value. Thanks to @ngokli.

    -
  • -

    Allow deprecation :debug mode to be switched on from MOCHA_OPTIONS environment variable.

    -
- -

0.13.0

-
  • -

    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.

    -
  • -

    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.

    -
  • -

    Deprecated require 'mocha_standalone' and require 'mocha/standalone'. Use require 'mocha/api instead.

    -
  • -

    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.

    -
  • -

    Extracted Mocha::Hooks module from Mocha::API and added documentation for test library authors.

    -
  • -

    Improvements to documentation. Much of it has been combined into the README file.

    -
  • -

    Fix #101 - Mock#respond_to? doesn't work with a string argument - thanks to @urbanautomaton.

    -
  • -

    Fix #105 - Travis link in README - thanks to @cknadler.

    -
  • -

    Various improvements to automated testing of integration with test libraries.

    -
  • -

    Make deprecation warnings more prominent.

    -
- -

0.12.7

-
  • -

    Officially support minitest v4.1.0 (still monkey-patching).

    -
- -

0.12.6

-
  • -

    Fixes #103.

    -
- -

0.12.5

-
  • -

    Officially support minitest v3.5.0 (still monkey-patching).

    -
- -

0.12.4

-
  • -

    Officially support minitest v3.4.0 & test-unit v2.5.2 (still monkey-patching).

    -
- -

0.12.3

-
  • -

    Revert rename of undocumented internal module since it turns out Rails/ActiveSupport is relying on its existence.

    -
- -

0.12.2

-
  • -

    Officially support minitest v3.3.0 (still monkey-patching)

    -
- -

0.12.1

-
  • -

    Deprecation warning (instead of fail fast) if neither Test::Unit nor MiniTest is loaded. Fixes #88.

    -
  • -

    Remove deprecated access to Mocha::Standalone.

    -
  • -

    Remove the deprecated file stubba.rb.

    -
  • -

    Officially support test-unit v2.5.1 (still monkey-patching).

    -
  • -

    Improve the API acceptance test.

    -
- -

0.12.0

-
  • -

    Fail fast if neither Test::Unit nor MiniTest is loaded. Fixes #40.

    -
  • -

    Officially support MiniTest up to v3.2.0 (still monkey-patching).

    -
  • -

    Officially support test-unit v2.5.0 (still monkey-patching).

    -
  • -

    Do not monkey-patch Test::Unit or MiniTest unless we know it's ok.

    -
  • -

    Add acceptance tests to demonstrate using a block as a custom parameter matcher.

    -
  • -

    Update Travis CI build status image to use the new build under the freerange account.

    -
- -

0.11.4

- - -

0.11.3

-
  • -

    Fix for #78 i.e. alias Object#method as Object#_method, not Object#method which already exists as another Ruby method.

    -
- -

0.11.2

-
  • -

    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 github.com/rails/rails/pull/5907 for further info.

    -
- -

0.11.1

-
  • -

    In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76.

    -
- -

0.11.0

-
  • -

    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.

    -
  • -

    Attempting to stub a method on a frozen object should fail fast. See #68.

    -
  • -

    Prevent stubbing a method on nil by default. See #68.

    -
  • -

    Generate documentation using YARD instead of Rdoc - removes dependency on Coderay.

    -
  • -

    Publish documentation on Github pages instead of Rubyforge - uses rake task written by @tomafro.

    -
  • -

    Remove agiledox which has outlived it's usefulness.

    -
  • -

    Removed trailing whitespace throughout codebase.

    -
  • -

    Add documentation for Mock#unstub.

    -
  • -

    Improve documentation for ObjectMethods.

    -
  • -

    Provide a way to run multiple tests within a single acceptance test method.

    -
- -

0.10.5

-
  • -

    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.

    -
  • -

    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.

    -
  • -

    Add links to README for source code & issue tracker.

    -
  • -

    Fix for issue #67 - Make the travis-ci badge visible in the README. Thanks to Diego Plentz for pull request.

    -
  • -

    Fix for issue #70 - Rename Mock#expectations to Mock#expectations to avoid conflicts. Thanks to Jeremy Stephens for pull request.

    -
- -

0.10.4

-
  • -

    Fix for issue #65 - expectations not being verified in subsequent tests.

    -
  • -

    Fix for issue #63 - require Mocha::Mockery at Mocha::Mock class load time and not on invocation of Mock#method_missing.

    -
  • -

    Fix for issue #45 - raise ArgumentError if Mocha::ParameterMatchers#has_entry is given Hash with wrong number of entries.

    -
  • -

    Make global variable name more obscure to avoid clashes with other libraries.

    -
  • -

    Move travis-ci-related gemfiles into their own directory.

    -
- -

0.10.3

-
  • -

    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.

    -
- -

0.10.2

-
  • -

    Merge pull request #53. Unstubbing a method should not remove expectations for other stubbed methods. Fixes #52. Thanks to saikat.

    -
- -

0.10.1

-
  • -

    Merge pull request #51. Use Gem::Requirement & Gem::Version for version comparison. Fixes issue #50. Thanks to meineerde.

    -
  • -

    Fixed typo in rdoc for Mocha::ObjectMethods.

    -
  • -

    Improve README as suggested in issue #46. Explain that Mocha must be loaded after test libraries and how to achieve this using Bundler.

    -
  • -

    Merge pull request #43 - nobody expects the spanish inquisition! Thanks to cairo140.

    -
  • -

    Fix for issue #39 - improve documentation for Expectation#multiple_yields.

    -
  • -

    Fix for issue #38 where a subtle change in test-unit v2.3.0 had been missed - only visible in verbose mode.

    -
  • -

    Support for MiniTest up to v2.6.2 has been verified.

    -
  • -

    Add explicit development dependency on coderay for generating syntax-highlighted code examples.

    -
- -

0.10.0

-
  • -

    Add Expectation#throws to allow a stubbed method to use Kernel#throw.

    -
  • -

    Updates for versions of Test::Unit up to and including v2.3.3 (including patch by Jens Fahnenbruck).

    -
  • -

    Updates for versions of MiniTest up to and including v2.5.1.

    -
  • -

    Since the singleton method added by Mocha masks the underlying instance method, there's no need to move it out the way and then back again. This fixes Github issue #20, because the original method is left unchanged - github.com/floehopper/mocha/issues/20 (thanks to Nick Lewis).

    -
  • -

    Handle stubbing of a singleton method, leaving the original method unchanged after the test.

    -
  • -

    When stubbing an instance method that was originally defined as a singleton method, the original method should still exist after the test.

    -
  • -

    Fixed mis-print in Mocha::ObjectMethods#unstub documentation (patch by Gleb Pomykalov).

    -
  • -

    Improved test coverage around stubbing of methods defined in different ways - this makes use of the newly extracted introspection gem (although this means some tests are now failing in Ruby v1.9.2).

    -
  • -

    Added configuration for Travis continuous integration.

    -
  • -

    Make the gemspec the canonical reference and stop generating it from the Rakefile.

    -
  • -

    Use the built-in Bundler rake tasks for packaging the gem.

    -
  • -

    Use the “release” rake task provided by Bundler instead of using the Rake::XForge::Release functionality.

    -
  • -

    Extract Object#metaclass into a new metaclass gem.

    -
  • -

    Run rake tasks without bundle exec.

    -
  • -

    Avoid deprecation warning for rdoc rake task.

    -
  • -

    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.

    -
  • -

    Use multiple Gemfiles seems to run Travis CI builds against multiple version of test-unit & minitest.

    -
- -

0.9.12

-
  • -

    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.

    -
  • -

    Avoid 'circular require considered harmful' warning when running Mocha's tests in Ruby 1.9.2

    -
  • -

    Make performance tests work on Ruby 1.9.2 i.e. using MiniTest.

    -
  • -

    Declare rake as a development dependency with newer versions of Rubygems since it's only needed to carry out developer-related tasks.

    -
- -

0.9.11

-
  • -

    Added explicit support for minitest v1.5.0 to v2.0.2.

    -
  • -

    Make testable by rubygems-test.

    -
  • -

    Update links to my blog and make other links consistent.

    -
  • -

    Added a URI parameter matcher that ignores the order of query parameters so that tests can be independent of undefined hash ordering (patch by Paul Battley).

    -
  • -

    Include unexpected invocation in failure message and change the language slightly to make the failure message less confusing. See floehopper.lighthouseapp.com/projects/22289/tickets/52.

    -
  • -

    No need to create regular expression every time the BacktraceFilter#filtered method is called. See floehopper.lighthouseapp.com/projects/22289-mocha/tickets/66.

    -
- -

0.9.10

- - -

0.9.9

-
  • -

    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] floehopper.lighthouseapp.com/projects/22289-mocha/tickets/50#ticket-50-13

    -
  • -

    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.

    -
  • -

    Explicitly require rubygems for running tests via rake using test-unit gem.

    -
  • -

    Handle newer versions of test-unit gem (v2.0.2 to v2.0.9)

    -
  • -

    Handle newer versions of minitest gem (v1.4.0 to v1.6.0)

    -
  • -

    Added warnings about monkey-patching test-unit and minitest to aid debugging. These are enabled by including “debug” in the MOCHA_OPTIONS environment variable. This is now a comma-separated list, so that we can specify multiple options e.g. MOCHA_OPTIONS=debug,use_test_unit_gem

    -
  • -

    Eloy Duran (alloy) made the unit tests run on 1.9.2dev r25249.

    -
  • -

    Eloy Duran (alloy) also improved some MiniTest TestResult code I'd written and got the acceptance tests running on Ruby 1.9 HEAD. There are still 4 failures because for some reason the backtrace line numbers are off by one. And the minitest_test test case does not run when the whole suite is run with MiniTest. These issues still need investigation.

    -
  • -

    Fixed some acceptance tests to run in Ruby 1.9.2 - it's no longer possible to subvert the protection of a method by calling it via Object#send.

    -
  • -

    Fixed “test:performance” rake task so it runs in Ruby 1.9.2.

    -
  • -

    Fix test incorrectly failing under Rubinius 1.0. This test imposed too many constraints. It appears that Object#inspect legitimately calls Object#object_id in Rubinius. But we're only interested in what 'id' methods Mocha::ObjectMethods#mocha_inspect calls. By stubbing Object#inspect we can relax the constraints imposed by the test.

    -
  • -

    Luke Redpath (lukeredpath) added new shorthand “any” and “all” composite parameter matchers using “&” and “|”. This provides an alternative syntax for expecting any or all matchers to pass, e.g. foo.expects(:bar).with(equals(1) | equals(2)).

    -
  • -

    Improved documentation for Expectation#raises. A number of people have suggested an extension to the API to cope with custom exceptions that have extra constructor parameters. However, since the arguments supplied to Expectation#raises are just passed on to Kernel#raise, it's possible to pass in an instance of an exception. Thus no change to the API is required, but it does seem worthwhile pointing this out in the docs.

    -
  • -

    Corrected RDoc example for Expectation#never thanks to Red David (reddavis).

    -
  • -

    Improved RDoc including a change suggested by Rohit Arondekar (rohit).

    -
  • -

    Updated gemspec as requested by Sam Woodard (shwoodard).

    -
- -

0.9.8

-
  • -

    Fixed bug “NameError raised when using Mocha as a Rails plug-in” - 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.

    -
  • -

    Make Mocha::ParameterMatchers#regexp_matches, #includes, #has_value, #has_key more robust. Thanks to Sander Hartlage.

    -
  • -

    Allow passing a block to Mocha::Configuration methods to only change configuration for the duration of the block. Thanks to Dan Manges.

    -
  • -

    Fixed bug “doc generation fails in 0.9.7 gem” - floehopper.lighthouseapp.com/projects/22289/tickets/51.

    -
  • -

    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.

    -
- -

0.9.7

-
  • -

    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.

    -
- -

0.9.6

-
  • -

    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'.

    -
  • -

    Stop requiring rubygems - this should be an environmental choice for the user. gist.github.com/54177 - describes why requiring rubygems in your library code is a bad idea.

    -
  • -

    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.

    -
  • -

    Added support for 'test-unit' gem (version >= 2.0). Note that as with other versions of Test::Unit I'm completely replacing the TestCase#run method. Unfortunately in version 2.0.0 this method differs slightly from the same method in version 2.0.1 & 2.0.2, so we have to provide different implementations to ensure that the internal working of Test::Unit are not compromised by Mocha. Note also that unless the 'test-unit' gem is loaded, requiring 'test/unit' leads to a mixture of stdlib and gem classes being loaded causing errors. To avoid a dependency on rubygems, the gem is loaded only if MOCHA_OPTIONS is set to 'use_test_unit_gem' - this option is only intended for use in running Mocha's own tests. It might be worthwhile to create a shim gem like minitest_tu_shim to allow the test-unit gem to completely replace the stdlib, but that's a job for another day. The changes in the Rakefile are to make the default task run with the 'test-unit' gem (version >= 2.0).

    -
  • -

    Renamed Mocha::Standalone to Mocha::API to better reflect its purpose. Added a deprecation warning for those who are referencing Mocha::Standalone.

    -
  • -

    Fix exception raised by HasEntry#matches? if first param is not a Hash (thanks to Taylor Barstow).

    -
  • -

    Ken Collins reported [1] that Mocha is always loading MiniTest if it is available and loading it causes some Rails/ActionPack tests to break. I've removed the loading of MiniTest, but this now means the user has to ensure that if they want to use MiniTest in conjunction with Mocha, he must load MiniTest before loading Mocha. [1] rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2060

    -
  • -

    Implemented Bacon integration (thanks to Ubiratan Pires Alberton), but this was then removed after deciding only to maintain integration with Test::Unit and MiniTest which are both Ruby standard libraries. See mailing list for details.

    -
  • -

    Don't monkey-patch MiniTest if it's already been monkey-patched by Mocha.

    -
  • -

    Fixed bug: MiniTest integration was counting ExpectationErrors as errors not failures. floehopper.lighthouseapp.com/projects/22289-mocha/tickets/41.

    -
  • -

    Fixed bug: Some Bacon tests were failing in Ruby 1.9.1. floehopper.lighthouseapp.com/projects/22289-mocha/tickets/43.

    -
  • -

    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 - floehopper.lighthouseapp.com/projects/22289/tickets/49.

    -
  • -

    Made Mocha compatible with minitest 1.4.0 and above (thanks to Denis Defreyne).

    -
- -

0.9.5

-
  • -

    Fixed Lighthouse bug #32 - stub_everything should mean mock responds to anything.

    -
  • -

    Added Expectation#twice to improve readability. Thanks to pull request from Celestino Gomes.

    -
  • -

    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.

    -
  • -

    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 - intertwingly.net/blog/2008/01/07/Rake-Contrib-for-1-9

    -
- -

0.9.4

-
  • -

    Added mocha.gemspec file generated with Chad Woolley's new rake task, so that a floehopper-mocha gem will get built on GitHub.

    -
  • -

    Add rake task to update mocha.gemspec with unique version, which will cause gem to be auto-built on github

    -
  • -

    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] rubyforge.org/tracker/index.php?func=detail&aid=23055&group_id=1917&atid=7480

    -
  • -

    Removed deprecated gem autorequire.

    -
- -

0.9.3

-
  • -

    Added support for MiniTest thanks to Jeff Smick.

    -
  • -

    Fixed a possible bug with some of the non-default Configuration options relating to the argument to Object#respond_to?

    -
  • -

    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] blog.jayfields.com/2008/07/ruby-underuse-of-modules.html & blog.jayfields.com/2008/07/ruby-redefine-method-behavior.html

    -
  • -

    Removed deprecated gem autorequire.

    -
- -

0.9.2

-
  • -

    Improved documentation to address [#22530] 'Mock methods with multiple return values not possible?'

    -
  • -

    respond_with parameter matcher was not available in tests.

    -
  • -

    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.

    -
- -

0.9.1

-
  • -

    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.

    -
  • -

    By removing Mock#unexpected_method_called we reduce the number of methods vulnerable to the problem that surfaced in bug #21563.

    -
  • -

    Fix bug #21563 - stubbing 'verified?' method is unsafe. Instance method names on the Mock class should be more obscure.

    -
  • -

    Performance improvement. StubbaExampleTest goes twice as fast on my local machine.

    -
  • -

    Added primitive performance test to default rake task.

    -
  • -

    Fix format of case statements which don't work in Ruby 1.9 and make others consistent.

    -
  • -

    There is no point in running (potentially expensive) checks if configuration is set to allow such checks to fail. This is a relatively quick fix in response to Chris McGrath's performance problems.

    -
  • -

    Fix for bug #21161 - 'uninitialized constant Deprecation in stubba.rb'.

    -
  • -

    It's more readable to talk about 'once' and 'twice' rather than '1 time' and '2 times'.

    -
  • -

    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.

    -
- -

0.9.0

- - -

0.5.5

-
  • -

    Renamed Matches parameter matcher to RegexpMatches for clarity.

    -
  • -

    Added noframes tag to rdoc index to assist Google.

    -
- -

0.5.4

-
  • -

    Added matches parameter matcher for matching regular expressions.

    -
- -

0.5.3

-
  • -

    Attempt to fix packaging problems by switching to newer version (1.15.1) of gnutar and setting COPY_EXTENDED_ATTRIBUTES_DISABLE environment variable.

    -
  • -

    Removed unused ExpectationSequenceError exception.

    -
  • -

    Added instance_of and kind_of parameter matchers.

    -
  • -

    Added Google Webmaster meta tag to rdoc template header.

    -
  • -

    Put Google Webmaster meta tag in the right header i.e. the one for the index page.

    -
- -

0.5.2

-
  • -

    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).

    -
  • -

    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.

    -
- -

0.5.1

-
  • -

    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.

    -
- -

0.5.0

-
  • -

    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.

    -
- -

object = mock() object.expects(:method).with(has_key('key_1')) object.method('key_1' => 1, 'key_2' => 2) # no verification error raised

- -

object = mock() object.expects(:method).with(has_key('key_1')) object.method('key_2' => 2) # verification error raised, because method was not called with Hash containing key: 'key_1'

-
  • -

    Values Returned and Exceptions Raised on Consecutive Invocations - Allow multiple calls to Expectation#returns and Expectation#raises to build up a sequence of responses to invocations on the mock. Added syntactic sugar method Expectation#then to allow more readable expectations.

    -
- -

object = mock() object.stubs(:method).returns(1, 2).then.raises(Exception).then.returns(4) object.method # => 1 object.method # => 2 object.method # => raises exception of class Exception object.method # => 4

-
  • -

    Yields on Consecutive Invocations - Allow multiple calls to yields on single expectation to allow yield parameters to be specified for consecutive invocations.

    -
- -

object = mock() object.stubs(:method).yields(1, 2).then.yields(3) object.method { |values| p values } # => [1, 2] object.method { |values| p values } # => [3]

-
  • -

    Multiple Yields on Single Invocation - Added Expectation#multiple_yields to allow a mocked or stubbed method to yield multiple times for a single invocation.

    -
- -

object = mock() object.stubs(:method).multiple_yields([1, 2], [3]) object.method { |*values| p values } # => [1, 2] # => [3]

-
  • -

    Invocation Dispatch - Expectations were already being matched in reverse order i.e. the most recently defined one was being found first. This is still the case, but we now stop matching an expectation when its maximum number of expected invocations is reached. c.f. JMock v1. A stub will never stop matching by default. Hopefully this means we can soon get rid of the need to pass a Proc to Expectation#returns.

    -
- -

object = mock() object.stubs(:method).returns(2) object.expects(:method).once.returns(1) object.method # => 1 object.method # => 2 object.method # => 2 # no verification error raised

- -

# The following should still work…

- -

Time.stubs(:now).returns(Time.parse('Mon Jan 01 00:00:00 UTC 2007')) Time.now # => Mon Jan 01 00:00:00 UTC 2007 Time.stubs(:now).returns(Time.parse('Thu Feb 01 00:00:00 UTC 2007')) Time.now # => Thu Feb 01 00:00:00 UTC 2007

-
  • -

    Deprecate passing an instance of Proc to Expectation#returns.

    -
  • -

    Explicitly include all Rakefile dependencies in project.

    -
  • -

    Fixed old Stubba example.

    -
  • -

    Fix so that it is possible for a stubbed method to raise an Interrupt exception without a message in Ruby 1.8.6

    -
  • -

    Added responds_like and quacks_like.

    -
  • -

    Capture standard object methods before Mocha adds any.

    -
  • -

    Added Expectation#once method to make interface less surprising.

    -
  • -

    Use Rake::TestTask to run tests. Created three separate tasks to run unit, integration & acceptance tests. Split inspect_test into one file per TestCase. Deleted superfluous all_tests file.

    -
  • -

    Fiddled with mocha_inspect and tests to give more sensible results on x86 platform.

    -
  • -

    Fixed bug #7834 “infinite_range.rb makes incorrect assumption about to_f” logged by James Moore.

    -
- -

0.4.0

-
  • -

    Allow naming of mocks (patch from Chris Roos).

    -
  • -

    Specify multiple return values for consecutive calls.

    -
  • -

    Improved consistency of expectation error messages.

    -
  • -

    Allow mocking of Object instance methods e.g. kind_of?, type.

    -
  • -

    Provide aliased versions of #expects and #stubs to allow mocking of these methods.

    -
  • -

    Added at_least, at_most, at_most_once methods to expectation.

    -
  • -

    Allow expects and stubs to take a hash of method and return values.

    -
  • -

    Eliminate warning: “instance variable @yield not initialized” (patch from Xavier Shay).

    -
  • -

    Restore instance methods on partial mocks (patch from Chris Roos).

    -
  • -

    Allow stubbing of a method with non-word characters in its name (patch from Paul Battley).

    -
  • -

    Removed coupling to Test::Unit.

    -
  • -

    Allow specified exception instance to be raised (patch from Chris Roos).

    -
  • -

    Make mock object_id appear in hex like normal Ruby inspect (patch from Paul Battley).

    -
  • -

    Fix path to object.rb in rdoc rake task (patch from Tomas Pospisek).

    -
  • -

    Reverse order in which expectations are matched, so that last expectation is matched first. This allows e.g. a call to #stubs to be effectively overridden by a call to #expects (patch from Tobias Lutke).

    -
  • -

    Stubba & SmartTestCase modules incorporated into Mocha module so only need to require 'mocha' - no longer need to require 'stubba'.

    -
  • -

    AutoMocha removed.

    -
- -

0.3.3

-
  • -

    Quick bug fix to restore instance methods on partial mocks (for Kevin Clark).

    -
- -

0.3.2

-
  • -

    Examples added.

    -
- -

0.3.1

-
  • -

    Dual licensing with MIT license added.

    -
- -

0.3.0

-
  • -

    Rails plugin.

    -
  • -

    Auto-verify for expectations on concrete classes.

    -
  • -

    Include each expectation verification in the test result assertion count.

    -
  • -

    Filter out noise from assertion backtraces.

    -
  • -

    Point assertion backtrace to line where failing expectation was created.

    -
  • -

    New yields method for expectations.

    -
  • -

    Create stubs which stub all method calls.

    -
  • -

    Mocks now respond_to? expected methods.

    -
- -

0.2.1

-
  • -

    Rename MochaAcceptanceTest::Rover#move method to avoid conflict with Rake (in Ruby 1.8.4 only?)

    -
- -

0.2.0

-
  • -

    Small change to SetupAndTeardown#teardown_stubs suggested by Luke Redpath (www.lukeredpath.co.uk) to allow use of Stubba with RSpec (rspec.rubyforge.org).

    -
  • -

    Reorganized directory structure and extracted addition of setup and teardown methods into SmartTestCase mini-library.

    -
  • -

    Addition of auto-verify for Mocha (but not Stubba). This means there is more significance in the choice of expects or stubs in that any expects on a mock will automatically get verified.

    -
- -

So instead of…

- -

wotsit = Mocha.new wotsit.expects(:thingummy).with(5).returns(10) doobrey = Doobrey.new(wotsit) doobrey.hoojamaflip wotsit.verify

- -

you need to do…

- -

wotsit = mock() wotsit.expects(:thingummy).with(5).returns(10) doobrey = Doobrey.new(wotsit) doobrey.hoojamaflip # no need to verify

- -

There are also shortcuts as follows…

- -

instead of…

- -

wotsit = Mocha.new wotsit.expects(:thingummy).returns(10) wotsit.expects(:summat).returns(25)

- -

you can have…

+

Release Notes

+ +

1.14.0

+ +

External changes

+ +
    +
  • Mock#expects,#stubs should return last expectation - thanks to @vlad-pisanov for #524 (b6b637db)
  • +
+ +

Internal changes

+ +
    +
  • Avoid breaking change in psych v4 in ruby v3.1 (08b9f4ca)
  • +
  • Remove broken Dependabot badge from README (d446657a)
  • +
  • Add Ruby 3.0 to the CI matrix - thanks to @mishina2228 for #526 (65bc626e)
  • +
  • Move development dependencies from gemspec to Gemfile - thanks to @mishina2228 for #527 (dd127f7b)
  • +
+ +

1.13.0

+ +

External changes

+ +
    +
  • Add ParameterMatchers#has_keys - thanks to @cstyles for #512 (18d8104)
  • +
  • Fix misleading exception message in ParameterMatchers#has_entry - thanks to @cstyles for #513 (9c4ef13)
  • +
  • Only add dependency on rubocop if we're actually going to use it (f2f879f)
  • +
  • Fix rake dependency constraints for older Ruby versions (7ce5f29)
  • +
+ +

Internal changes

+ +
    +
  • Check documentation can be generated as part of CircleCI build (b30d9a9)
  • +
  • Add --fail-on-warning option to yard rake task (53a6ee3)
  • +
  • Add a weekly scheduled build to the CircleCI build (fd2a4c6)
  • +
  • Add Ruby v1.8 to the CircleCI build matrix (818ca03)
  • +
  • Add API token to fix CircleCI badge in README (607c5aa)
  • +
  • Provide wrapped option for #mocha_inspect on hashes & arrays (d8f44bc)
  • +
  • Use CircleCI instead of TravisCI for automated builds (c98c6ec)
  • +
  • Switch to newer default Travis CI build env (c78f75c)
  • +
  • Use latest Ruby versions in Travis CI builds (9e0043a)
  • +
  • Use latest JRuby v9.2.18 in Travis CI builds (8c99a1b)
  • +
  • Use consistent JRuby versions in Travis CI builds (0f849aa)
  • +
  • Use more recent version of JRuby in Travis CI build matrix (58653db)
  • +
+ +

1.12.0

+ +

External changes

+ +
    +
  • Various improvements to README inspired by #207 and #390 - thanks to @nitishr for his work on #390 (fed0eee6)
  • +
  • Improve documentation related to StateMachine classes - thanks to @nitishr (#425 & #427)
  • +
  • Fix regression in cardinality introduced in v1.10.0 (59454a8) and reported in #473 - thanks to @srvance for reporting and @nitishr for fixing (#474)
  • +
  • Fix documentation for Mocha::Expectation#when - thanks to @olleolleolle (b4f59daa & #477)
  • +
  • Remove Mocha::Mock#respond_to? from documentation - thanks to @nitishr (#480)
  • +
  • Improvements to documentation for Expectation#yields & #multiple_yields - thanks to @andyw8 for reporting in #495 (1b6571c)
  • +
  • Remove documentation & tests from gem to reduce its size by over 50% - thanks to @gabetax (#500)
  • +
  • Update documentation to point to travis-ci.com instead of travis-ci.org
  • +
+ +

Internal changes

+ +
    +
  • Refactor StateMachine-related classes - thanks to @nitishr (#425 & #427)
  • +
  • Remove redundant test - thanks to @nitishr (8e4f1a7c)
  • +
  • Add Ruby 2.7 to Travis CI matrix - thanks to @bastelfreak (fc5ea2f2)
  • +
  • Simplify Mockery - thanks to @nitishr (#449)
  • +
  • Update Travis CI badge to point to main vs master branch (bd8028f8)
  • +
  • Generate docs using newer version of yard (v0.9.25) (c619afac)
  • +
  • Manually upgrade jquery in docs from v1.7.1 -> v1.9.0 to fix CVE-2017-16011 (211098a5, dd5eeedb & 1b76e4d5; also see #492)
  • +
  • Remove reference to non-existent jquery source map to fix error in Chrome developer tools (20156555)
  • +
  • Temporarily ignore Ruby v1.8.7 build failures (e5b9feef)
  • +
+ +

1.11.2

+ +

External changes

+ +
    +
  • Fix regression introduced in v1.10.0 that meant Object#inspect was called unnecessarily (368abd98)
  • +
  • Warn when mock object receives invocations in another test - thanks to @nitishr (#442)
  • +
  • Avoid rubocop comments appearing in YARD-generated docs (d8019eed)
  • +
+ +

Internal changes

+ +
    +
  • Replace StubbedMethod#original_method & #original_visibility attribute reader methods with instance variables - thanks to @nitishr (d917f332)
  • +
  • Set up MochaExampleTest & StubbaExampleTest as acceptance tests - thanks to @nitishr (4881cc58)
  • +
  • Delete unused PrettyParameters class - thanks to @nitishr (314ea922)
  • +
+ +

1.11.1

+ +

External changes

+ +
    +
  • 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)
  • +
+ +

1.11.0

+ +

External changes

+ +
    +
  • Add Expectation#with_block_given & Expectation#with_no_block_given (#441). + +
      +
    • Allows non-deprecated solution for #382. Thanks to @yemartin for reporting and to @techbelly & @nitishr for feedback.
    • +
  • +
  • Fix issue with non-Array arguments passed to Expectation#multiple_yields (#444). + +
      +
    • The undocumented behaviour is now properly supported and documented.
    • +
  • +
+ +

Internal changes

+ +
    +
  • Move static YARD options from Rake task to .yardopts file - thanks to @nitishr (#429)
  • +
  • Simplify implementation of yielding functionality - thanks to @nitishr (#439)
  • +
  • Add missing require statement to acceptance_test_helper.rb (1070fc02)
  • +
  • Add some baseline acceptance tests for yielding behaviour (c2cac911)
  • +
  • Display a sponsor button on GitHub repo page (9fc5911b)
  • +
  • Use new Deprecation.warning behaviour in Invocation#call (932d1166)
  • +
+ +

1.10.2

+ +
    +
  • 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): + +
      +
    • The behaviour of API#mock, API#stub and API#stub_everything when called with a symbol as the first argument.
    • +
    • The behaviour of Expectation#yields and Expectation#multiple_yields when the stubbed method is called without a block.
    • +
  • +
+ +

1.10.1

+ +
    +
  • Ensure ObjectMethods & ClassMethods included when API extended (43778756)
  • +
  • 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)
  • +
+ +

1.10.0

+ +
    +
  • Improve deprecation warning when requiring 'mocha/setup' (388f44d7)
  • +
  • Add documentation for Cucumber integration (13ab797b)
  • +
  • Add documentation about an undocumented feature of API#mock, API#stub & API#stub_everything being changed (7ed2e4e7, d30c1717)
  • +
+ +

1.10.0.beta.1

+ +
    +
  • Hide ClassMethods#method_visibility & #method_exists? methods to avoid clash with Rails (#428)
  • +
+ +

1.10.0.alpha

+ +

External changes

+ +
    +
  • Remove dependency on metaclass gem (#49, #365)
  • +
  • Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377)
  • +
  • More realistic examples in documentation for Expectation#yields and #multiple_yields - thanks to @nitishr (#352, #383)
  • +
  • Improve documentation for Mock#responds_like & #responds_like_instance_of - thanks to @nitishr (#337, #384)
  • +
  • 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)
  • +
  • Document MOCHA_OPTIONS in README - thanks to @nitishr (#311, #386)
  • +
  • Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385)
  • +
  • Deprecation warning if integration using 'mocha/test_unit' or 'mocha/minitest' fails - thanks to @nitishr (#229, #389, c6032d0b)
  • +
  • Require at least one specified sequence for Expectation#in_sequence - thanks to @nitishr (#79, #396, 9020248a)
  • +
  • Make signatures of Mock#unstub & ObjectMethods#unstub consistent - thanks to @nitishr (#397, f04d437)
  • +
  • Deprecate requiring 'mocha/setup' (36adf880)
  • +
  • Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410)
  • +
  • Put deprecations into effect (#400, #418): + +
      +
    • Remove deprecated 'mocha_standalone.rb' & 'mocha/standalone.rb'
    • +
    • Fail fast if no test library loaded
    • +
    • Removed optional block for Mocha::API#mock, #stub & #stub_everything
    • +
    • Remove deprecated ParameterMatchers#has_equivalent_query_string method
    • +
    • Remove deprecated 'mocha/mini_test.rb'
    • +
  • +
  • Fix typo in docs for Mocha::Configuration.prevent (266ce71c)
  • +
  • New-style configuration (see documentation for Mocha::Configuration) (#407, #421)
  • +
  • Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d)
  • +
  • Deprecate support for versions of test-unit & minitest which need monkey-patching (a34e1a88)
  • +
  • Deprecate old-style Rails plugin (#403, 2df77134)
  • +
  • Documentation fixes & improvements which also fix YARD warnings (472d5416, a2c0d64a)
  • +
+ +

Internal changes

+ +
    +
  • Pin minitest to v5.11.3 for Ruby v1.8.7 to fix build; minitest no longer supports Ruby v1.8.7 (4a0a580)
  • +
  • Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f)
  • +
  • Only run rubocop for MRI Ruby versions & non-integration test builds (8f1c6af)
  • +
  • Reduce duplication in any instance method class - thanks to @nitishr (#378)
  • +
  • Simplify AnyInstanceMethod, ClassMethod, InstanceMethod, ModuleMethod class hierarchy - thanks to @nitishr (#381)
  • +
  • Simplify ClassMethods#method_exists? & ObjectMethods#method_exists? making them consistent - thanks to @nitishr (#270, #362, #370)
  • +
  • Don't override definition of singleton_class in ClassMethods - thanks to @nitishr (#391, #392)
  • +
  • Do not include 'method_definer' methods into all objects (#268, #402)
  • +
  • Distinguish different ObjectMethods modules (#268, #404)
  • +
  • Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411)
  • +
  • Consistently use assert_raises - thanks to @nitishr (#405, #412, a66b7bed)
  • +
  • Update Ruby & JRuby versions in Travis CI config (18cb1a93, eb061c53)
  • +
  • Rubocop improvements (aa16ea67...6f4db70b, 2a1240e6...e95716ae)
  • +
  • Fix inconsistency in CardinalityTest (aa10e0a8)
  • +
  • Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535)
  • +
  • Remove default argument in Expectation#invoke - thanks to @nitishr (#414, #420)
  • +
+ +

1.9.0

+ +
    +
  • Add TruffleRuby to Travis CI build matrix - thanks to @deepj (#354)
  • +
  • Explicitly set Travis CI OS to Ubuntu Trusty 14.04 (ded1fa45)
  • +
  • Expand explanation of thread-safety concerns - thanks to @techbelly (#357)
  • +
  • Refactor class method and any instance method - thanks to @chrisroos (#358)
  • +
  • Rely on default bundler version in Travis CI builds (3352e9c5)
  • +
  • Fix local build-matrix script (11abe231)
  • +
  • No need to install latest bundler in build-matrix script (8247a894)
  • +
+ +

1.8.0

+ +
    +
  • Constrain rubocop version to avoid breaking Travis CI builds (05e507f5)
  • +
  • Avoid calling Kernel#format from ObjectMethods#mocha_inspect - thanks to @hoffmanilya (#345)
  • +
  • Fix build matrix script (#346)
  • +
  • Avoid deprecation warning in gemspec (4976e0bc)
  • +
  • Removed link to documentation translation (ef428ea2)
  • +
  • Don't use the new bundler v2 in builds (683ded9b)
  • +
  • Moved documentation from https://gofreerange.com/mocha/docs to https://mocha.jamesmead.org/ 683ded...a17fde
  • +
+ +

1.7.0

+ +
    +
  • Update Ruby & JRuby versions in Travis CI config (9bf55631 & 3883af7e)
  • +
  • Simplify gemspec (63744f86)
  • +
  • Add rubocop and fix most cop violations (#341)
  • +
  • Use Kernel#warn for deprecations - thanks to @etiennebarrie (#333, 196970a)
  • +
+ +

1.6.0

+ +
    +
  • Fix subtle bug in setting correct visibility of stubbed module methods on Kernel or Object - thanks to @chrisroos (#295)
  • +
  • Avoid mocks for partial mocking leaking into subsequent tests - thanks to @skliew for reporting (#331)
  • +
  • Remove OpenCollective badge, backers & sponsors (a283a079)
  • +
  • Change gem version badge to SVG format and add SemVer stability badge - thanks to @greysteil (#335)
  • +
  • Improve documentation for Configuration (#236)
  • +
+ +

1.5.0

+ +
    +
  • Prevent use of Mocha outside the context of a test/example - thanks to @andyw8 & @lzap (#327)
  • +
+ +

1.4.0

+ +
    +
  • Fix deprecation warning for assert_nil in ClassMethodTest (#308 & #309)
  • +
  • Display file and line number in deprecation warning - thanks to @chrisarcand (#310, #312 & #313)
  • +
  • Rename mocha/mini_test.rb to mocha/minitest.rb - thanks to @grosser (#320 & #322)
  • +
  • Fix warning when delegating to mock in Ruby 2.4 - thanks to @tjvc (#321 & #323)
  • +
  • Updates to Travis CI configuration (73af600..9732726 & 0426e5e)
  • +
+ +

1.3.0

+ +
    +
  • Ensure all tests run individually - thanks to @chrisroos (#267)
  • +
  • Update Travis CI build status badge to show master branch status (#264)
  • +
  • Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)
  • +
  • Fix pretty printing of quotes in String#mocha_inspect (#215 & #223)
  • +
  • Add release instructions to README - thanks to @chrisroos (70a5febd & 3c664df7)
  • +
  • Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)
  • +
  • Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos (8f58eddf)
  • +
  • Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 & eca7560c)
  • +
  • Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)
  • +
  • Add latest stable version of JRuby to Travis CI build matrix (#288)
  • +
  • Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)
  • +
  • Deprecate passing block to mock object constructor (#290)
  • +
  • Add a known issue to README for Ruby bug 12876 (#276)
  • +
  • Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga (#297)
  • +
  • Fix Mocha::ParameterMatchers#includes for Array values - thanks to @timcraft (#302)
  • +
  • Use faster container-based virtual environments for Travis CI builds (#305)
  • +
  • Rename Mocha::ParameterMatchers::QueryStringMatches to QueryString (#306)
  • +
  • Handle blank parameter value for query string matcher - thanks to @weynsee (#303 & #304)
  • +
  • Rename Mocha::ParameterMatchers::QueryString -> EquivalentUri (#307)
  • +
  • Use do ... end instead of { ... } in acceptance tests - thanks to @chrisroos (#294)
  • +
+ +

1.2.1

+ + + +

1.2.0

+ +
    +
  • Always use prepended module to stub class & instance methods for Ruby v2+ - thanks to @grosser & @chrisroos (43d56671, #244)
  • +
  • Always use prepended module to stub AnyInstance methods in Ruby v2+ - thanks to @chrisroos (#262)
  • +
  • Always set visibility of stub method to match stubbed method on included module - thanks to @grosser & @chrisroos (e87c03b0, #248)
  • +
  • Always set visibility to stub method to match stubbed method on superclass - thanks to @chrisroos (38d902ad)
  • +
  • Allow stubbing of method to which any instance responds (#200)
  • +
  • Allow includes matcher to take matcher arguments - thanks to @lazyatom (#217)
  • +
  • Avoid exception in older version of Rubygems - thanks to @chrisroos (78d930a7)
  • +
  • Add licenses to gemspec as requested by @coreyhaines (#201)
  • +
  • Fix typo in README - thanks to @jaredbeck (6119460d)
  • +
  • Added section about using Mocha with RSpec & Rails to README (#221)
  • +
  • Fix documentation for Mocha::API#stub method - thanks to @raeno (599b1dcd)
  • +
  • Added backers and sponsors from OpenCollective - thanks to @piamancini (#253)
  • +
  • Fix typo in docs for equals - thanks to @alexcoco (#254)
  • +
  • Add known issue for Ruby v1.8 to README - thanks to @chrisroos (2c642096)
  • +
+ +

1.1.0

+ +
    +
  • Set visibility of any instance stub method.
  • +
  • Stub methods with a prepended method if there are other prepended methods. Thanks to @mrsimo.
  • +
  • Improve docs for Mock#responds_like & #responds_like_instance_of.
  • +
  • Use GitHub convention for instructions on contributing to Mocha.
  • +
  • Fix typos in docs. Thanks to @10io
  • +
+ +

1.0.0

+ +

External changes

+ +
    +
  • Assume 'mocha' has been required when requiring 'mocha/setup'.
  • +
  • Provide shortcuts for integrating with specific test library i.e. require 'mocha/test_unit' or require 'mocha/mini_test' +as alternatives to require 'mocha/setup'.
  • +
  • Do not automatically try to integrate with test libraries. Since the automatic test library integration functionality +requires the test library to be loaded and this doesn't usually happen until after the bundle is loaded, it makes things +simpler if we use require 'mocha/setup' to explicitly setup Mocha when we know the test library has been loaded. Fixes #146 & #155.
  • +
  • Consider stubs on superclasses if none exist on primary receiver. Largely based on changes suggested by @ccutrer in #145. +Note: this may break existing tests which rely on the old behaviour. Stubbing a superclass method and then invoking that +method on a child class would previously cause an unexpected invocation error. By searching up through the inheritance +hierarchy for each of the delegate mock objects, we can provide more intuitive behaviour. Instead of an unexpected invocation +error, invoking the method on the child class will cause the stubbed method on the superclass to be used.
  • +
  • Avoid recursion when constructing unexpected invocation message. Fixes #168.
  • +
  • Add explanation of method dispatch. Heavily based on the relevant jMock v1 documentation. Fixes #172.
  • +
  • Make class_eval line number more accurate. This sets the line number as the line number of the def statement. Closes #169.
  • +
  • Allow nesting of responds_with parameter matcher. Closes #166.
  • +
  • Define Mocha module before it's referenced. The test helper defines a class TestCase within the Mocha module. When +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.
  • +
  • Document lack of thread-safety. Fixes #154.
  • +
  • Document how to use the build-matrix script. Fixes #160.
  • +
  • Stubbing non-public method should use same visibility. This will probably break some existing tests that were somehow relying +on the stubbed method being public while the original method was protected or private. Fixes #150.
  • +
+ +

Internal changes

+ +
    +
  • Use lastest Rubygems in Travis CI builds.
  • +
  • Run the standard test suite against Ruby 2.1.0 in the build matrix.
  • +
  • Run integration tests against Ruby 2.0.0 with latest Test::Unit gem in the build matrix.
  • +
  • Test::Unit is not available in Ruby v1.9.3 standard library, so remove it from the build matrix.
  • +
  • Force use of Test::Unit runner, etc in relevant integration tests. Prior to this, I don't think we were really testing the +Mocha integration with Test::Unit much, because, although TestUnitTest was a subclass of Test::Unit::TestCase, the +important test case instances are the temporary ones built by TestRunner#run_as_test et al. Prior to this change, these +would only have used Test::Unit where MiniTest was not available at all i.e. only in early versions of Ruby and when the +MiniTest gem was not loaded.
  • +
  • Reset environment variables between build matrix builds.
  • +
  • Only activate integration with relevant test library for each of the integration tests.
  • +
  • Include standard build combinations from Travis CI config i.e. builds using standard library versions of test libraries.
  • +
  • Fix build-matrix.rb script. Also use .travis.yml to decide what combinations to run. This means we +can now simulate the Travis CI build locally and avoid duplication. Fixes #157.
  • +
  • Remove Ruby version map from build matrix script. I'm using the rbenv-aliases plugin to alias minor versions to the +relevant patch version.
  • +
+ +

0.14.0

+ +
    +
  • Official support for MiniTest v5. All tests now pass on the continuous integration build.
  • +
+ +

0.14.0.alpha

+ +
    +
  • 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.
  • +
  • Documentation updates.
  • +
+ +

0.13.3

+ +
    +
  • Allow Mocha::ParameterMatchers#includes to accept multiple items. Thanks to @simao.
  • +
  • Allow stubbing of private Kernel methods. Fixes #134. Thanks to @camski for reporting.
  • +
  • Avoid a warning when test/unit/version is required by other libraries in the same project. Fixes #140. Thanks to @tmiller.
  • +
  • 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.
  • +
  • Safer restoration of stubbed method visibility. Fixes #141. Thanks to @tmm1.
  • +
  • Ensure Mockery instance gets reset even if exception raised. Fixes #144.
  • +
  • Adapt Mocha acceptance tests to cope with changes in output from latest (v4.6.2) of MiniTest.
  • +
  • Updates to README about Rails compatibility.
  • +
+ +

0.13.2

+ +
    +
  • Stubbing of methods re-declared with different visibilty. Fixes #109.
  • +
  • Add Mock#responds_like_instance_of. Fixes #119.
  • +
  • Make Expectation#inspect less verbose and more useful. Fixes #122.
  • +
  • Make unit tests more robust to changes in environment. Fixes #121.
  • +
  • Update README in an attempt to head Rails-related issues off at the pass.
  • +
  • Add a Gem Badge to provide a link to Mocha on Rubygems.
  • +
  • Make documentation example consistent with other examples.
  • +
+ +

0.13.1

+ +
    +
  • Fix #97 - Mocha::ParameterMatchers#has_entry does not work with an Array as the entry's value. Thanks to @ngokli.
  • +
  • Allow deprecation :debug mode to be switched on from MOCHA_OPTIONS environment variable.
  • +
+ +

0.13.0

+ +
    +
  • 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.
  • +
  • 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.
  • +
  • Deprecated require 'mocha_standalone' and require 'mocha/standalone'. Use require 'mocha/api instead.
  • +
  • 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.
  • +
  • Extracted Mocha::Hooks module from Mocha::API and added documentation for test library authors.
  • +
  • Improvements to documentation. Much of it has been combined into the README file.
  • +
  • Fix #101 - Mock#respond_to? doesn't work with a string argument - thanks to @urbanautomaton.
  • +
  • Fix #105 - Travis link in README - thanks to @cknadler.
  • +
  • Various improvements to automated testing of integration with test libraries.
  • +
  • Make deprecation warnings more prominent.
  • +
+ +

0.12.7

+ +
    +
  • Officially support minitest v4.1.0 (still monkey-patching).
  • +
+ +

0.12.6

+ +
    +
  • Fixes #103.
  • +
+ +

0.12.5

+ +
    +
  • Officially support minitest v3.5.0 (still monkey-patching).
  • +
+ +

0.12.4

+ +
    +
  • Officially support minitest v3.4.0 & test-unit v2.5.2 (still monkey-patching).
  • +
+ +

0.12.3

+ +
    +
  • Revert rename of undocumented internal module since it turns out Rails/ActiveSupport is relying on its existence.
  • +
+ +

0.12.2

+ +
    +
  • Officially support minitest v3.3.0 (still monkey-patching)
  • +
+ +

0.12.1

+ +
    +
  • Deprecation warning (instead of fail fast) if neither Test::Unit nor MiniTest is loaded. Fixes #88.
  • +
  • Remove deprecated access to Mocha::Standalone.
  • +
  • Remove the deprecated file stubba.rb.
  • +
  • Officially support test-unit v2.5.1 (still monkey-patching).
  • +
  • Improve the API acceptance test.
  • +
+ +

0.12.0

+ +
    +
  • Fail fast if neither Test::Unit nor MiniTest is loaded. Fixes #40.
  • +
  • Officially support MiniTest up to v3.2.0 (still monkey-patching).
  • +
  • Officially support test-unit v2.5.0 (still monkey-patching).
  • +
  • Do not monkey-patch Test::Unit or MiniTest unless we know it's ok.
  • +
  • Add acceptance tests to demonstrate using a block as a custom parameter matcher.
  • +
  • Update Travis CI build status image to use the new build under the freerange account.
  • +
+ +

0.11.4

+ + + +

0.11.3

+ +
    +
  • Fix for #78 i.e. alias Object#method as Object#method, not Object#method_ which already exists as another Ruby method.
  • +
+ +

0.11.2

+ +
    +
  • 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.
  • +
+ +

0.11.1

+ +
    +
  • In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76.
  • +
+ +

0.11.0

+ +
    +
  • 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.
  • +
  • Attempting to stub a method on a frozen object should fail fast. See #68.
  • +
  • Prevent stubbing a method on nil by default. See #68.
  • +
  • Generate documentation using YARD instead of Rdoc - removes dependency on Coderay.
  • +
  • Publish documentation on Github pages instead of Rubyforge - uses rake task written by @tomafro.
  • +
  • Remove agiledox which has outlived it's usefulness.
  • +
  • Removed trailing whitespace throughout codebase.
  • +
  • Add documentation for Mock#unstub.
  • +
  • Improve documentation for ObjectMethods.
  • +
  • Provide a way to run multiple tests within a single acceptance test method.
  • +
+ +

0.10.5

+ +
    +
  • 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.
  • +
  • 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.
  • +
  • Add links to README for source code & issue tracker.
  • +
  • Fix for issue #67 - Make the travis-ci badge visible in the README. Thanks to Diego Plentz for pull request.
  • +
  • Fix for issue #70 - Rename Mock#expectations to Mock#expectations to avoid conflicts. Thanks to Jeremy Stephens for pull request.
  • +
+ +

0.10.4

+ +
    +
  • Fix for issue #65 - expectations not being verified in subsequent tests.
  • +
  • Fix for issue #63 - require Mocha::Mockery at Mocha::Mock class load time and not on invocation of Mock#method_missing.
  • +
  • Fix for issue #45 - raise ArgumentError if Mocha::ParameterMatchers#has_entry is given +Hash with wrong number of entries.
  • +
  • Make global variable name more obscure to avoid clashes with other libraries.
  • +
  • Move travis-ci-related gemfiles into their own directory.
  • +
+ +

0.10.3

+ +
    +
  • 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.
  • +
+ +

0.10.2

+ +
    +
  • Merge pull request #53. Unstubbing a method should not remove expectations for other stubbed methods. Fixes #52. Thanks to saikat.
  • +
+ +

0.10.1

+ +
    +
  • Merge pull request #51. Use Gem::Requirement & Gem::Version for version comparison. Fixes issue #50. Thanks to meineerde.
  • +
  • Fixed typo in rdoc for Mocha::ObjectMethods.
  • +
  • Improve README as suggested in issue #46. Explain that Mocha must be loaded after test libraries and how to achieve this using Bundler.
  • +
  • Merge pull request #43 - nobody expects the spanish inquisition! Thanks to cairo140.
  • +
  • Fix for issue #39 - improve documentation for Expectation#multiple_yields.
  • +
  • Fix for issue #38 where a subtle change in test-unit v2.3.0 had been missed - only visible in verbose mode.
  • +
  • Support for MiniTest up to v2.6.2 has been verified.
  • +
  • Add explicit development dependency on coderay for generating syntax-highlighted code examples.
  • +
+ +

0.10.0

+ +
    +
  • Add Expectation#throws to allow a stubbed method to use Kernel#throw.
  • +
  • Updates for versions of Test::Unit up to and including v2.3.3 (including patch by Jens Fahnenbruck).
  • +
  • Updates for versions of MiniTest up to and including v2.5.1.
  • +
  • Since the singleton method added by Mocha masks the underlying instance method, there's no need to move it out the way and then back again. This fixes Github issue #20, because the original method is left unchanged - https://github.com/floehopper/mocha/issues/20 (thanks to Nick Lewis).
  • +
  • Handle stubbing of a singleton method, leaving the original method unchanged after the test.
  • +
  • When stubbing an instance method that was originally defined as a singleton method, the original method should still exist after the test.
  • +
  • Fixed mis-print in Mocha::ObjectMethods#unstub documentation (patch by Gleb Pomykalov).
  • +
  • Improved test coverage around stubbing of methods defined in different ways - this makes use of the newly extracted introspection gem (although this means some tests are now failing in Ruby v1.9.2).
  • +
  • Added configuration for Travis continuous integration.
  • +
  • Make the gemspec the canonical reference and stop generating it from the Rakefile.
  • +
  • Use the built-in Bundler rake tasks for packaging the gem.
  • +
  • Use the "release" rake task provided by Bundler instead of using the Rake::XForge::Release functionality.
  • +
  • Extract Object#metaclass into a new metaclass gem.
  • +
  • Run rake tasks without bundle exec.
  • +
  • Avoid deprecation warning for rdoc rake task.
  • +
  • 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.
  • +
  • Use multiple Gemfiles seems to run Travis CI builds against multiple version of test-unit & minitest.
  • +
+ +

0.9.12

+ +
    +
  • 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.
  • +
  • Avoid 'circular require considered harmful' warning when running Mocha's tests in Ruby 1.9.2
  • +
  • Make performance tests work on Ruby 1.9.2 i.e. using MiniTest.
  • +
  • Declare rake as a development dependency with newer versions of Rubygems since it's only needed to carry out developer-related tasks.
  • +
+ +

0.9.11

+ +
    +
  • Added explicit support for minitest v1.5.0 to v2.0.2.
  • +
  • Make testable by rubygems-test.
  • +
  • Update links to my blog and make other links consistent.
  • +
  • Added a URI parameter matcher that ignores the order of query parameters so that tests can be independent of undefined hash ordering (patch by Paul Battley).
  • +
  • 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.
  • +
  • No need to create regular expression every time the BacktraceFilter#filtered method is called. See http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/66.
  • +
+ +

0.9.10

+ + + +

0.9.9

+ +
    +
  • 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
  • +
  • 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.
  • +
  • Explicitly require rubygems for running tests via rake using test-unit gem.
  • +
  • Handle newer versions of test-unit gem (v2.0.2 to v2.0.9)
  • +
  • Handle newer versions of minitest gem (v1.4.0 to v1.6.0)
  • +
  • Added warnings about monkey-patching test-unit and minitest to aid debugging. These are enabled by including "debug" in the MOCHA_OPTIONS environment variable. This is now a comma-separated list, so that we can specify multiple options e.g. MOCHA_OPTIONS=debug,use_test_unit_gem
  • +
  • Eloy Duran (alloy) made the unit tests run on 1.9.2dev r25249.
  • +
  • Eloy Duran (alloy) also improved some MiniTest TestResult code I'd written and got the acceptance tests running on Ruby 1.9 HEAD. There are still 4 failures because for some reason the backtrace line numbers are off by one. And the minitest_test test case does not run when the whole suite is run with MiniTest. These issues still need investigation.
  • +
  • Fixed some acceptance tests to run in Ruby 1.9.2 - it's no longer possible to subvert the protection of a method by calling it via Object#send.
  • +
  • Fixed "test:performance" rake task so it runs in Ruby 1.9.2.
  • +
  • Fix test incorrectly failing under Rubinius 1.0. This test imposed too many constraints. It appears that Object#inspect legitimately calls Object#object_id in Rubinius. But we're only interested in what 'id' methods Mocha::ObjectMethods#mocha_inspect calls. By stubbing Object#inspect we can relax the constraints imposed by the test.
  • +
  • Luke Redpath (lukeredpath) added new shorthand "any" and "all" composite parameter matchers using "&" and "|". This provides an alternative syntax for expecting any or all matchers to pass, e.g. foo.expects(:bar).with(equals(1) | equals(2)).
  • +
  • Improved documentation for Expectation#raises. A number of people have suggested an extension to the API to cope with custom exceptions that have extra constructor parameters. However, since the arguments supplied to Expectation#raises are just passed on to Kernel#raise, it's possible to pass in an instance of an exception. Thus no change to the API is required, but it does seem worthwhile pointing this out in the docs.
  • +
  • Corrected RDoc example for Expectation#never thanks to Red David (reddavis).
  • +
  • Improved RDoc including a change suggested by Rohit Arondekar (rohit).
  • +
  • Updated gemspec as requested by Sam Woodard (shwoodard).
  • +
+ +

0.9.8

+ +
    +
  • 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.
  • +
  • Make Mocha::ParameterMatchers#regexp_matches, #includes, #has_value, #has_key more robust. Thanks to Sander Hartlage.
  • +
  • Allow passing a block to Mocha::Configuration methods to only change configuration for the duration of the block. Thanks to Dan Manges.
  • +
  • Fixed bug "doc generation fails in 0.9.7 gem" - http://floehopper.lighthouseapp.com/projects/22289/tickets/51.
  • +
  • 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.
  • +
+ +

0.9.7

+ +
    +
  • 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.
  • +
+ +

0.9.6

+ +
    +
  • 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'.
  • +
  • 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.
  • +
  • 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.
  • +
  • Added support for 'test-unit' gem (version >= 2.0). Note that as with other versions of Test::Unit I'm completely replacing the TestCase#run method. Unfortunately in version 2.0.0 this method differs slightly from the same method in version 2.0.1 & 2.0.2, so we have to provide different implementations to ensure that the internal working of Test::Unit are not compromised by Mocha. Note also that unless the 'test-unit' gem is loaded, requiring 'test/unit' leads to a mixture of stdlib and gem classes being loaded causing errors. To avoid a dependency on rubygems, the gem is loaded only if MOCHA_OPTIONS is set to 'use_test_unit_gem' - this option is only intended for use in running Mocha's own tests. It might be worthwhile to create a shim gem like minitest_tu_shim to allow the test-unit gem to completely replace the stdlib, but that's a job for another day. The changes in the Rakefile are to make the default task run with the 'test-unit' gem (version >= 2.0).
  • +
  • Renamed Mocha::Standalone to Mocha::API to better reflect its purpose. Added a deprecation warning for those who are referencing Mocha::Standalone.
  • +
  • Fix exception raised by HasEntry#matches? if first param is not a Hash (thanks to Taylor Barstow).
  • +
  • Ken Collins reported [1] that Mocha is always loading MiniTest if it is available and loading it causes some Rails/ActionPack tests to break. I've removed the loading of MiniTest, but this now means the user has to ensure that if they want to use MiniTest in conjunction with Mocha, he must load MiniTest before loading Mocha. [1] http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2060
  • +
  • Implemented Bacon integration (thanks to Ubiratan Pires Alberton), but this was then removed after deciding only to maintain integration with Test::Unit and MiniTest which are both Ruby standard libraries. See mailing list for details.
  • +
  • Don't monkey-patch MiniTest if it's already been monkey-patched by Mocha.
  • +
  • Fixed bug: MiniTest integration was counting ExpectationErrors as errors not failures. http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/41.
  • +
  • Fixed bug: Some Bacon tests were failing in Ruby 1.9.1. http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/43.
  • +
  • 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.
  • +
  • Made Mocha compatible with minitest 1.4.0 and above (thanks to Denis Defreyne).
  • +
+ +

0.9.5

+ +
    +
  • Fixed Lighthouse bug #32 - stub_everything should mean mock responds to anything.
  • +
  • Added Expectation#twice to improve readability. Thanks to pull request from Celestino Gomes.
  • +
  • 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.
  • +
  • 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
  • +
+ +

0.9.4

+ +
    +
  • Added mocha.gemspec file generated with Chad Woolley's new rake task, so that a floehopper-mocha gem will get built on GitHub.
  • +
  • Add rake task to update mocha.gemspec with unique version, which will cause gem to be auto-built on github
  • +
  • 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
  • +
  • Removed deprecated gem autorequire.
  • +
+ +

0.9.3

+ + + +

0.9.2

+ +
    +
  • Improved documentation to address [#22530] 'Mock methods with multiple return values not possible?'
  • +
  • respond_with parameter matcher was not available in tests.
  • +
  • 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.
  • +
+ +

0.9.1

+ +
    +
  • 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.
  • +
  • By removing Mock#unexpected_method_called we reduce the number of methods vulnerable to the problem that surfaced in bug #21563.
  • +
  • Fix bug #21563 - stubbing 'verified?' method is unsafe. Instance method names on the Mock class should be more obscure.
  • +
  • Performance improvement. StubbaExampleTest goes twice as fast on my local machine.
  • +
  • Added primitive performance test to default rake task.
  • +
  • Fix format of case statements which don't work in Ruby 1.9 and make others consistent.
  • +
  • There is no point in running (potentially expensive) checks if configuration is set to allow such checks to fail. This is a relatively quick fix in response to Chris McGrath's performance problems.
  • +
  • Fix for bug #21161 - 'uninitialized constant Deprecation in stubba.rb'.
  • +
  • It's more readable to talk about 'once' and 'twice' rather than '1 time' and '2 times'.
  • +
  • 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.
  • +
+ +

0.9.0

+ + + +

0.5.5

+ +
    +
  • Renamed Matches parameter matcher to RegexpMatches for clarity.
  • +
  • Added noframes tag to rdoc index to assist Google.
  • +
+ +

0.5.4

+ +
    +
  • Added matches parameter matcher for matching regular expressions.
  • +
+ +

0.5.3

+ +
    +
  • Attempt to fix packaging problems by switching to newer version (1.15.1) of gnutar and setting COPY_EXTENDED_ATTRIBUTES_DISABLE environment variable.
  • +
  • Removed unused ExpectationSequenceError exception.
  • +
  • Added instance_of and kind_of parameter matchers.
  • +
  • Added Google Webmaster meta tag to rdoc template header.
  • +
  • Put Google Webmaster meta tag in the right header i.e. the one for the index page.
  • +
+ +

0.5.2

+ +
    +
  • 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).
  • +
  • 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.
  • +
+ +

0.5.1

+ +
    +
  • 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.
  • +
+ +

0.5.0

+ +
    +
  • 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.
  • +
+ +

object = mock() + object.expects(:method).with(has_key('key_1')) + object.method('key_1' => 1, 'key_2' => 2) + # no verification error raised

+ +

object = mock() + object.expects(:method).with(has_key('key_1')) + object.method('key_2' => 2) + # verification error raised, because method was not called with Hash containing key: 'key_1'

+ +
    +
  • Values Returned and Exceptions Raised on Consecutive Invocations - Allow multiple calls to Expectation#returns and Expectation#raises to build up a sequence of responses to invocations on the mock. Added syntactic sugar method Expectation#then to allow more readable expectations.
  • +
+ +

object = mock() + object.stubs(:method).returns(1, 2).then.raises(Exception).then.returns(4) + object.method # => 1 + object.method # => 2 + object.method # => raises exception of class Exception + object.method # => 4

+ +
    +
  • Yields on Consecutive Invocations - Allow multiple calls to yields on single expectation to allow yield parameters to be specified for consecutive invocations.
  • +
+ +

object = mock() + object.stubs(:method).yields(1, 2).then.yields(3) + object.method { |*values| p values } # => [1, 2] + object.method { |*values| p values } # => [3]

+ +
    +
  • Multiple Yields on Single Invocation - Added Expectation#multiple_yields to allow a mocked or stubbed method to yield multiple times for a single invocation.
  • +
+ +

object = mock() + object.stubs(:method).multiple_yields([1, 2], [3]) + object.method { |*values| p values } # => [1, 2] # => [3]

+ +
    +
  • Invocation Dispatch - Expectations were already being matched in reverse order i.e. the most recently defined one was being found first. This is still the case, but we now stop matching an expectation when its maximum number of expected invocations is reached. c.f. JMock v1. A stub will never stop matching by default. Hopefully this means we can soon get rid of the need to pass a Proc to Expectation#returns.
  • +
+ +

object = mock() + object.stubs(:method).returns(2) + object.expects(:method).once.returns(1) + object.method # => 1 + object.method # => 2 + object.method # => 2 + # no verification error raised

+ +

# The following should still work...

+ +

Time.stubs(:now).returns(Time.parse('Mon Jan 01 00:00:00 UTC 2007')) + Time.now # => Mon Jan 01 00:00:00 UTC 2007 + Time.stubs(:now).returns(Time.parse('Thu Feb 01 00:00:00 UTC 2007')) + Time.now # => Thu Feb 01 00:00:00 UTC 2007

+ +
    +
  • Deprecate passing an instance of Proc to Expectation#returns.
  • +
  • Explicitly include all Rakefile dependencies in project.
  • +
  • Fixed old Stubba example.
  • +
  • Fix so that it is possible for a stubbed method to raise an Interrupt exception without a message in Ruby 1.8.6
  • +
  • Added responds_like and quacks_like.
  • +
  • Capture standard object methods before Mocha adds any.
  • +
  • Added Expectation#once method to make interface less surprising.
  • +
  • Use Rake::TestTask to run tests. Created three separate tasks to run unit, integration & acceptance tests. Split inspect_test into one file per TestCase. Deleted superfluous all_tests file.
  • +
  • Fiddled with mocha_inspect and tests to give more sensible results on x86 platform.
  • +
  • Fixed bug #7834 "infinite_range.rb makes incorrect assumption about to_f" logged by James Moore.
  • +
+ +

0.4.0

+ +
    +
  • Allow naming of mocks (patch from Chris Roos).
  • +
  • Specify multiple return values for consecutive calls.
  • +
  • Improved consistency of expectation error messages.
  • +
  • Allow mocking of Object instance methods e.g. kind_of?, type.
  • +
  • Provide aliased versions of #expects and #stubs to allow mocking of these methods.
  • +
  • Added at_least, at_most, at_most_once methods to expectation.
  • +
  • Allow expects and stubs to take a hash of method and return values.
  • +
  • Eliminate warning: "instance variable @yield not initialized" (patch from Xavier Shay).
  • +
  • Restore instance methods on partial mocks (patch from Chris Roos).
  • +
  • Allow stubbing of a method with non-word characters in its name (patch from Paul Battley).
  • +
  • Removed coupling to Test::Unit.
  • +
  • Allow specified exception instance to be raised (patch from Chris Roos).
  • +
  • Make mock object_id appear in hex like normal Ruby inspect (patch from Paul Battley).
  • +
  • Fix path to object.rb in rdoc rake task (patch from Tomas Pospisek).
  • +
  • Reverse order in which expectations are matched, so that last expectation is matched first. This allows e.g. a call to #stubs to be effectively overridden by a call to #expects (patch from Tobias Lutke).
  • +
  • Stubba & SmartTestCase modules incorporated into Mocha module so only need to require 'mocha' - no longer need to require 'stubba'.
  • +
  • AutoMocha removed.
  • +
+ +

0.3.3

+ +
    +
  • Quick bug fix to restore instance methods on partial mocks (for Kevin Clark).
  • +
+ +

0.3.2

+ +
    +
  • Examples added.
  • +
+ +

0.3.1

+ +
    +
  • Dual licensing with MIT license added.
  • +
+ +

0.3.0

+ +
    +
  • Rails plugin.
  • +
  • Auto-verify for expectations on concrete classes.
  • +
  • Include each expectation verification in the test result assertion count.
  • +
  • Filter out noise from assertion backtraces.
  • +
  • Point assertion backtrace to line where failing expectation was created.
  • +
  • New yields method for expectations.
  • +
  • Create stubs which stub all method calls.
  • +
  • Mocks now respond_to? expected methods.
  • +
+ +

0.2.1

+ +
    +
  • Rename MochaAcceptanceTest::Rover#move method to avoid conflict with Rake (in Ruby 1.8.4 only?)
  • +
+ +

0.2.0

+ +
    +
  • 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).
  • +
  • Reorganized directory structure and extracted addition of setup and teardown methods into SmartTestCase mini-library.
  • +
  • Addition of auto-verify for Mocha (but not Stubba). This means there is more significance in the choice of expects or stubs in that any expects on a mock will automatically get verified.
  • +
+ +

So instead of...

+ +

wotsit = Mocha.new + wotsit.expects(:thingummy).with(5).returns(10) + doobrey = Doobrey.new(wotsit) + doobrey.hoojamaflip + wotsit.verify

+ +

you need to do...

+ +

wotsit = mock() + wotsit.expects(:thingummy).with(5).returns(10) + doobrey = Doobrey.new(wotsit) + doobrey.hoojamaflip + # no need to verify

+ +

There are also shortcuts as follows...

+ +

instead of...

+ +

wotsit = Mocha.new + wotsit.expects(:thingummy).returns(10) + wotsit.expects(:summat).returns(25)

+ +

you can have...

wotsit = mock(:thingummy => 5, :summat => 25)

-

and instead of…

+

and instead of...

-

wotsit = Mocha.new wotsit.stubs(:thingummy).returns(10) wotsit.stubs(:summat).returns(25)

+

wotsit = Mocha.new + wotsit.stubs(:thingummy).returns(10) + wotsit.stubs(:summat).returns(25)

-

you can have…

+

you can have...

wotsit = stub(:thingummy => 5, :summat => 25)

-

0.1.2

-
  • -

    Minor tweaks

    -
+

0.1.2

+ +
    +
  • Minor tweaks
  • +
+ +

0.1.1

-

0.1.1

-
  • -

    Initial release.

    -
+
    +
  • Initial release.
  • +
@@ -454,9 +438,9 @@

License

diff --git a/docs/top-level-namespace.html b/docs/top-level-namespace.html index 9ae68ad08..29070880f 100644 --- a/docs/top-level-namespace.html +++ b/docs/top-level-namespace.html @@ -6,7 +6,7 @@ Top Level Namespace - — Mocha 1.13.0 + — Mocha 1.14.0 @@ -108,9 +108,9 @@

Defined Under Namespace