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 | 22bfca05cd9a089c1fabbdaab31fd2dad881fb4c (patch) | |
tree | 2a8ec33a6b7e234e93ecd3a0b87db5abb04710f1 /t/test-custodian-util-timespan.rb | |
parent | e2863db7243787e7afda894be43b64eb834b3291 (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.
Diffstat (limited to 't/test-custodian-util-timespan.rb')
-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 |