# File lib/mocha/mock.rb, line 40 40: def expects(method_name_or_hash, backtrace = nil) 41: if method_name_or_hash.is_a?(Hash) then 42: method_name_or_hash.each do |method_name, return_value| 43: ensure_method_not_already_defined(method_name) 44: @expectations.add(Expectation.new(self, method_name, backtrace).returns(return_value)) 45: end 46: else 47: ensure_method_not_already_defined(method_name_or_hash) 48: @expectations.add(Expectation.new(self, method_name_or_hash, backtrace)) 49: end 50: end