summaryrefslogtreecommitdiffhomepage
path: root/mrblib/compar.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrblib/compar.rb')
-rw-r--r--mrblib/compar.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/mrblib/compar.rb b/mrblib/compar.rb
index 40fb2e7f0..44595974a 100644
--- a/mrblib/compar.rb
+++ b/mrblib/compar.rb
@@ -13,7 +13,7 @@ module Comparable
def < other
cmp = self <=> other
if cmp.nil?
- false
+ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp < 0
true
else
@@ -30,7 +30,7 @@ module Comparable
def <= other
cmp = self <=> other
if cmp.nil?
- false
+ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp <= 0
true
else
@@ -62,7 +62,7 @@ module Comparable
def > other
cmp = self <=> other
if cmp.nil?
- false
+ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp > 0
true
else
@@ -79,7 +79,7 @@ module Comparable
def >= other
cmp = self <=> other
if cmp.nil?
- false
+ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp >= 0
true
else