summaryrefslogtreecommitdiff
path: root/test/date/test_date_arith.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/date/test_date_arith.rb')
-rw-r--r--test/date/test_date_arith.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/date/test_date_arith.rb b/test/date/test_date_arith.rb
index 96622ba..d0d27d7 100644
--- a/test/date/test_date_arith.rb
+++ b/test/date/test_date_arith.rb
@@ -262,4 +262,17 @@ class TestDateArith < Test::Unit::TestCase
assert_equal(8, e.to_a.size)
end
+ def test_step__compare
+ o = Object.new
+ def o.<=>(*);end
+ assert_raise(ArgumentError) {
+ Date.new(2000, 1, 1).step(3, o).to_a
+ }
+
+ o = Object.new
+ def o.<=>(*);2;end
+ a = []
+ Date.new(2000, 1, 1).step(3, o) {|d| a << d}
+ assert_empty(a)
+ end
end