diff options
Diffstat (limited to 'spec/ruby/core/range/fixtures')
| -rw-r--r-- | spec/ruby/core/range/fixtures/classes.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/ruby/core/range/fixtures/classes.rb b/spec/ruby/core/range/fixtures/classes.rb index de46d7d4a9..3a1df010b2 100644 --- a/spec/ruby/core/range/fixtures/classes.rb +++ b/spec/ruby/core/range/fixtures/classes.rb @@ -40,6 +40,28 @@ module RangeSpecs end end + class WithoutSucc + include Comparable + attr_reader :n + + def initialize(n) + @n = n + end + + def eql?(other) + inspect.eql? other.inspect + end + alias :== :eql? + + def inspect + "WithoutSucc(#{@n})" + end + + def <=>(other) + @n <=> other.n + end + end + class Xs < Custom # represent a string of 'x's def succ Xs.new(@length + 1) @@ -62,4 +84,7 @@ module RangeSpecs class MyRange < Range end + + class ComparisonError < RuntimeError + end end |
