1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Hiroshi SHIBATA 2019-12-10 21:21:19 +09:00
parent 95f570d0d3
commit 2a2a707829
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -19,8 +19,7 @@ class TestLogPeriod < Test::Unit::TestCase
next_month = Time.parse("2019-08-1 00:00:00")
assert_equal(next_month, monthly_result)
result = Logger::Period.next_rotate_time(time, 'invalid')
assert_equal(time, result)
assert_raise(ArgumentError) { Logger::Period.next_rotate_time(time, 'invalid') }
end
def test_next_rotate_time_extreme_cases
@ -39,8 +38,7 @@ class TestLogPeriod < Test::Unit::TestCase
next_month = Time.parse("2018-08-1 00:00:00")
assert_equal(next_month, monthly_result)
result = Logger::Period.next_rotate_time(time, 'invalid')
assert_equal(time, result)
assert_raise(ArgumentError) { Logger::Period.next_rotate_time(time, 'invalid') }
end
def test_previous_period_end
@ -58,8 +56,7 @@ class TestLogPeriod < Test::Unit::TestCase
month_ago = Time.parse("2019-06-30 23:59:59")
assert_equal(month_ago, monthly_result)
result = Logger::Period.previous_period_end(time, 'invalid')
assert_equal(time, result)
assert_raise(ArgumentError) { Logger::Period.next_rotate_time(time, 'invalid') }
end
def test_previous_period_end_extreme_cases
@ -78,7 +75,6 @@ class TestLogPeriod < Test::Unit::TestCase
month_ago = Time.parse("2018-06-30 23:59:59")
assert_equal(month_ago, monthly_result)
result = Logger::Period.previous_period_end(time, 'invalid')
assert_equal(time, result)
assert_raise(ArgumentError) { Logger::Period.next_rotate_time(time, 'invalid') }
end
end