Added a spec that fails when type: Integer and nil is passed

Add positive tests here too in this context, that is when you pass an integer, it works. And add another test for different types, like a float and a string.