From 8a7af66bd4a1685436deda8344a8893bf221bc63 Mon Sep 17 00:00:00 2001 From: Nitish Rathi Date: Fri, 21 Feb 2020 12:33:31 +0000 Subject: [PATCH] remove the Spanish Inquisition special case Closes #468 and sets us up to reduce the surface area of the internal API exposed to users, by inlining anticipates into expects and using that from stubs --- lib/mocha/object_methods.rb | 3 --- test/unit/object_methods_test.rb | 4 ---- 2 files changed, 7 deletions(-) diff --git a/lib/mocha/object_methods.rb b/lib/mocha/object_methods.rb index 4d5020339..cb3e6f8a6 100644 --- a/lib/mocha/object_methods.rb +++ b/lib/mocha/object_methods.rb @@ -73,9 +73,6 @@ def stubba_method_for(method_name) # # @see Mock#expects def expects(expected_methods_vs_return_values) - if expected_methods_vs_return_values.to_s =~ /the[^a-z]*spanish[^a-z]*inquisition/i - raise ExpectationErrorFactory.build('NOBODY EXPECTS THE SPANISH INQUISITION!') - end anticipates(expected_methods_vs_return_values) end diff --git a/test/unit/object_methods_test.rb b/test/unit/object_methods_test.rb index 13b603a07..2abee0c8d 100644 --- a/test/unit/object_methods_test.rb +++ b/test/unit/object_methods_test.rb @@ -51,10 +51,6 @@ def test_should_stub_self_for_object assert_equal @object, @object.stubba_object end - def test_nobody_expects_the_spanish_inquisition - assert_raises(Mocha::ExpectationErrorFactory.exception_class) { @object.expects(:the_spanish_inquisition) } - end - def test_should_alias_object_method klass = Class.new { def self.method_x; end } klass.extend(Mocha::ObjectMethods)