Both MRI and Rubinius returns true when testing if an empty string starts with an empty string. But JRuby returns false. But when testing if the empty string ends with an empty string, they all return true.
I would suggest that JRuby should change its behavior for String#start_with?.
I've looked in the source code, but wasn't able to figure out where and how this change should be implemented, partly because it seems that the call is forwarded to some Java classes.
$ rvm jruby-head,ruby,rbx do ruby -e "p ''.start_with?('')"
false
true
true
$ rvm jruby-head,ruby,rbx do ruby -e "p ''.end_with?('')"
true
true
true
Both MRI and Rubinius returns
truewhen testing if an empty string starts with an empty string. But JRuby returnsfalse. But when testing if the empty string ends with an empty string, they all returntrue.I would suggest that JRuby should change its behavior for
String#start_with?.I've looked in the source code, but wasn't able to figure out where and how this change should be implemented, partly because it seems that the call is forwarded to some Java classes.