lib/mocha/infinite_range.rb in mocha-0.4.0 vs lib/mocha/infinite_range.rb in mocha-0.5.0

- old
+ new

@@ -10,18 +10,16 @@ def self.infinite 1/0.0 end - alias_method :__to_s__, :to_s - - def to_s - if first.to_f.infinite? then + def mocha_inspect + if first.respond_to?(:to_f) and first.to_f.infinite? then return "at most #{last}" - elsif last.to_f.infinite? then + elsif last.respond_to?(:to_f) and last.to_f.infinite? then return "at least #{first}" else - __to_s__ + to_s end end end \ No newline at end of file