summaryrefslogtreecommitdiff
path: root/spec/ruby/core/complex/spaceship_spec.rb
AgeCommit message (Collapse)Author
2020-01-28Update to ruby/spec@f8a2d54Benoit Daloze
2019-06-19Implement Complex#<=>Jeremy Evans
Implement Complex#<=> so that it is usable as an argument when calling <=> on objects of other classes (since #coerce will coerce such numbers to Complex). If the complex number has a zero imaginary part, and the other argument is a real number (or complex number with zero imaginary part), return -1, 0, or 1. Otherwise, return nil, indicating the objects are not comparable. Fixes [Bug #15857]