Fixing specs for jRuby
workaround for https://github.com/jruby/jruby/issues/591