I think you are looking for the wraps Mock parameter. Search the official documentation for wraps. Accessing attributes returns a mock object. Calling methods gives the real method result instead, if a return value is not configured for the mock.