ruby-changes:56848
From: Nobuyoshi <ko1@a...>
Date: Wed, 7 Aug 2019 09:59:37 +0900 (JST)
Subject: [ruby-changes:56848] Nobuyoshi Nakada: 1bf796c69d (master): Fix Date#step test
https://git.ruby-lang.org/ruby.git/commit/?id=1bf796c69d From 1bf796c69dcc61977a105474d08bbe2a51c88e0e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 7 Aug 2019 08:57:22 +0900 Subject: Fix Date#step test The document states that "the limit should be a date object". diff --git a/test/date/test_date_arith.rb b/test/date/test_date_arith.rb index e1f29db..c3633c9 100644 --- a/test/date/test_date_arith.rb +++ b/test/date/test_date_arith.rb @@ -277,16 +277,18 @@ class TestDateArith < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/date/test_date_arith.rb#L277 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/