code as module method with specs

I thought about it but, at the time, I wanted the code to give error even if it received a string.