diff options
Diffstat (limited to 'test/date/test_date_arith.rb')
-rw-r--r-- | test/date/test_date_arith.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/date/test_date_arith.rb b/test/date/test_date_arith.rb index f5ac5bf30b..5b03d6e7eb 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 |