From 6dfa287626bbf700bb37debf1003181e57c55265 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 24 Jun 2013 07:11:36 +0100 Subject: Updated the tests to ensure the "current hour" is valid. This means testing values outside the range of 0-23 (inclusive). We did this already for the start & end times. This updates #4451. --- t/test-custodian-util-timespan.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/t/test-custodian-util-timespan.rb b/t/test-custodian-util-timespan.rb index 200b8e1..307a171 100755 --- a/t/test-custodian-util-timespan.rb +++ b/t/test-custodian-util-timespan.rb @@ -39,17 +39,27 @@ class TestTimeSpanUtil < Test::Unit::TestCase assert_raise ArgumentError do result = Custodian::Util::TimeSpan.inside?( 1, i ) end + + assert_raise ArgumentError do + result = Custodian::Util::TimeSpan.inside?( 1, 2, i ) + end end # # Now negative values. # for i in 1..50 + assert_raise ArgumentError do result = Custodian::Util::TimeSpan.inside?( 1, ( -1 * i ) ) end + + assert_raise ArgumentError do + result = Custodian::Util::TimeSpan.inside?( ( -1 * i ), 1 ) + end + assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( ( -1 * i ), 1 ) + result = Custodian::Util::TimeSpan.inside?( 1, 1, ( -1 * i ) ) end end -- cgit v1.2.1