lib/rspec/mocks/method_double.rb in rspec-mocks-2.14.3 vs lib/rspec/mocks/method_double.rb in rspec-mocks-2.14.4
- old
+ new
@@ -252,9 +252,15 @@
raise_method_not_stubbed_error if stubs.empty?
expectations.empty? ? reset : stubs.clear
end
# @private
+ def remove_single_stub(stub)
+ stubs.delete(stub)
+ restore_original_method if stubs.empty? && expectations.empty?
+ end
+
+ # @private
def raise_method_not_stubbed_error
raise MockExpectationError, "The method `#{method_name}` was not stubbed or was already unstubbed"
end
# @private