There seems to be different behavior between JRuby 1.3.1 and MRI Ruby 1.8.7p72 when it comes to String comparison. MRI uses the <=> operator, whereas JRuby does not. This became an issue when I was trying to write a class that acted as an Enum type (for use with rails backed by postgres). The class was a subclass of String that overrode <=> to perform the comparison using an internal array containing the Enum values rather than the value of the Strings themselves. I was a bit surprised when my tests passed under ruby, but failed under jruby.
I've included a small test program and the output of both JRuby 1.3.1 and Ruby 1.8.7p72 (unfortunately, it isn't a junit test case, my apologies)
The text was updated successfully, but these errors were encountered:
Sorry that the ticket is unclear. This is an old ticket from the original JIRA issue tracker, JRUBY-3925. I tested it against JRuby 1.7.18 and JRuby 9000 and the behaviour is still the same as JRuby 1.3. The original ticket has 3 files with the output from the test.