summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-06-24 07:11:36 +0100
committerSteve Kemp <steve@steve.org.uk>2013-06-24 07:11:36 +0100
commit22bfca05cd9a089c1fabbdaab31fd2dad881fb4c (patch)
tree2a8ec33a6b7e234e93ecd3a0b87db5abb04710f1
parente2863db7243787e7afda894be43b64eb834b3291 (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-xt/test-custodian-util-timespan.rb12
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