53: def expects(method_name_or_hash)
54: if method_name_or_hash.to_s =~ /the[^a-z]*spanish[^a-z]*inquisition/i
55: raise Mocha::ExpectationError.new('NOBODY EXPECTS THE SPANISH INQUISITION!')
56: end
57: expectation = nil
58: mockery = Mocha::Mockery.instance
59: iterator = ArgumentIterator.new(method_name_or_hash)
60: iterator.each { |*args|
61: method_name = args.shift
62: mockery.on_stubbing(self, method_name)
63: method = stubba_method.new(stubba_object, method_name)
64: mockery.stubba.stub(method)
65: expectation = mocha.expects(method_name, caller)
66: expectation.returns(args.shift) if args.length > 0
67: }
68: expectation
69: end