diff options
author | Steve Kemp <steve@steve.org.uk> | 2013-06-24 07:11:36 +0100 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2013-06-24 07:11:36 +0100 |
commit | 6dfa287626bbf700bb37debf1003181e57c55265 (patch) | |
tree | d715efb220aeed91e20057c2f072816ebaf2f9c4 | |
parent | 5ff8506229d679afac3a74c3323f38890d36ce62 (diff) |
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.
-rwxr-xr-x | t/test-custodian-util-timespan.rb | 12 |
1 files changed, 11 insertions, 1 deletions
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 |