Fix tests on JRuby and Rubinius