Allow injecting the confirm function.