use spies to return value