Commit 587e0b01 authored by Masaki Muranaka's avatar Masaki Muranaka

Tests for Comparable. Still not all path coverage.

parent 73d7000b
assert('<', '15.3.3.2.1') do
class Foo
include Comparable
def <=>(x)
0
end
end
(Foo.new < Foo.new) == false
end
assert('<=', '15.3.3.2.2') do
class Foo
include Comparable
def <=>(x)
0
end
end
(Foo.new <= Foo.new) == true
end
assert('==', '15.3.3.2.3') do
class Foo
include Comparable
def <=>(x)
0
end
end
(Foo.new == Foo.new) == true
end
assert('>', '15.3.3.2.4') do
class Foo
include Comparable
def <=>(x)
0
end
end
(Foo.new > Foo.new) == false
end
assert('>=', '15.3.3.2.5') do
class Foo
include Comparable
def <=>(x)
0
end
end
(Foo.new >= Foo.new) == true
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment