Make spec compatible with JRuby.
Merge pull request #81 from maxigit/58824964_make_spec_jruby_compatible

rrMake spec compatible with JRuby.