Skip to content

Commit

Permalink
remove the Spanish Inquisition special case
Browse files Browse the repository at this point in the history
Closes freerange#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
  • Loading branch information
nitishr committed Feb 21, 2020
1 parent b80cb98 commit 8a7af66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions lib/mocha/object_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions test/unit/object_methods_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a7af66

Please sign in to comment.