Fix tests for different versions of ruby