Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing the Spanish Inquisition special case :( #469

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/mocha/object_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ def stubba_class
#
# @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
if frozen?
raise StubbingError.new("can't stub method on frozen object: #{mocha_inspect}", caller)
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