# File lib/mocha/object.rb, line 53 53: def expects(method_name_or_hash) 54: expectation = nil 55: mockery = Mocha::Mockery.instance 56: iterator = ArgumentIterator.new(method_name_or_hash) 57: iterator.each { |*args| 58: method_name = args.shift 59: mockery.on_stubbing(self, method_name) 60: method = stubba_method.new(stubba_object, method_name) 61: mockery.stubba.stub(method) 62: expectation = mocha.expects(method_name, caller) 63: expectation.returns(args.shift) if args.length > 0 64: } 65: expectation 66: end