I think checking nil and a number should cover the bases for things. Also, it isn't obvious here, but this is actually a clone of the test for Puppet::Parameter::Boolean