whole_func_string: function spy(obj, method) {
    if (!obj && !method) {
      obj = { spy: function(){} };
      method = 'spy';
    }
    return double(obj, method);
  }
func_code_string: function spy(obj, method) {
    if (!obj && !method) {
      obj = { spy: function(){} };
      method = 'spy';
    }
    return double(obj, method);
  }
func_documentation_string: Create a new spy object.
  
  It can replace existing method if `obj` and `method` are
  supplied.
  
  @param {Object} obj (optional)
  @param {String} method (optional)
  @returns {Function} test double
  @api public