summaryrefslogtreecommitdiff
path: root/test/date
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-07 08:57:22 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-07 09:43:11 +0900
commit1bf796c69dcc61977a105474d08bbe2a51c88e0e (patch)
treeca12735b99562e08d7f46d7e284417d5bfadd8fe /test/date
parenta0fe396555b164562f69e08e67b62d9904bcfaaa (diff)
Fix Date#step test
The document states that "the limit should be a date object".
Diffstat (limited to 'test/date')
-rw-r--r--test/date/test_date_arith.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/date/test_date_arith.rb b/test/date/test_date_arith.rb
index e1f29dbf22..c3633c9473 100644
--- a/test/date/test_date_arith.rb
+++ b/test/date/test_date_arith.rb
@@ -277,16 +277,18 @@ class TestDateArith < Test::Unit::TestCase
end
def test_step__compare
+ p = Date.new(2000, 1, 1)
+ q = Date.new(1999, 12, 31)
o = Object.new
def o.<=>(*);end
assert_raise(ArgumentError) {
- Date.new(2000, 1, 1).step(3, o).to_a
+ p.step(q, o).to_a
}
o = Object.new
def o.<=>(*);2;end
a = []
- Date.new(2000, 1, 1).step(3, o) {|d| a << d}
+ p.step(q, o) {|d| a << d}
assert_empty(a)
end
end