Skip to content

Commit eccb28d

Browse files
authored
Merge pull request #5000 from yui-knk/fix_test_cmp
Accept `nil` as an argument of `Rational#<=>`
2 parents ee2ee7f + fd8c917 commit eccb28d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

core/src/main/java/org/jruby/RubyRational.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ public IRubyObject op_cmp(ThreadContext context, IRubyObject other) {
674674
}
675675
return f_cmp(context, f_sub(context, num1, num2), RubyFixnum.zero(context.runtime));
676676
}
677-
return coerceBin(context, sites(context).op_cmp, other);
677+
return coerceCmp(context, sites(context).op_cmp, other);
678678
}
679679

680680
/** nurat_equal_p

test/mri/excludes/Rational_Test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
exclude :test_cmp, "needs investigation"
21
exclude :test_coerce, "needs investigation"
32
exclude :test_coerce2, "needs investigation"
43
exclude :test_conv, "needs investigation"

0 commit comments

Comments
 (0)