Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/numeric.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class Numeric
#
# No subclass in the Ruby Core or Standard Library uses this implementation.
#
def <=>: (Numeric other) -> Integer
def <=>: (Numeric other) -> Integer?

# <!--
# rdoc-file=numeric.c
Expand Down
6 changes: 6 additions & 0 deletions test/stdlib/Numeric_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ class NumericInstanceTest < Test::Unit::TestCase

testing 'Numeric'

def test_op_cmp
numeric = Numeric.new
assert_send_type '(Numeric) -> 0', numeric, :<=>, numeric
assert_send_type '(Numeric) -> nil', numeric, :<=>, Numeric.new
end

def test_real
assert_send_type '() -> Integer', 1, :real
assert_send_type '() -> Float', 1.0, :real
Expand Down
Loading