summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-05-15 13:00:17 +0100
committerSteve Kemp <steve@steve.org.uk>2013-05-15 13:00:17 +0100
commite7406b080cb36925ea290383531c7c3c41d9d5b9 (patch)
treede06a9a80193c37e4e54e0c9cdc74d77d5e95e0b
parent5ece9a9f52b3a450f9c15eda419102e05725f42f (diff)
Updated to test types of integer values.
-rwxr-xr-xt/test-custodian-settings.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/t/test-custodian-settings.rb b/t/test-custodian-settings.rb
index a39b545..8019062 100755
--- a/t/test-custodian-settings.rb
+++ b/t/test-custodian-settings.rb
@@ -38,4 +38,48 @@ class TestConfigurationSingleton < Test::Unit::TestCase
end
+ #
+ # Test that our settings are suitable types
+ #
+ def test_types
+ settings = Custodian::Settings.instance()
+
+
+ # retry delay - probably unset.
+ a = settings.retry_delay
+ assert( a.class == Fixnum )
+
+ # store a number
+ settings._store( "retry_delay", 5 )
+ a = settings.retry_delay
+ assert( a.class == Fixnum )
+ assert( a == 5 )
+
+ # store a string
+ settings._store( "retry_delay", "35" )
+ a = settings.retry_delay
+ assert( a.class == Fixnum )
+ assert( a == 35 )
+
+
+
+ # timeout - probably unset.
+ a = settings.timeout()
+ assert( a.class == Fixnum )
+
+ # store a number
+ settings._store( "timeout", 5 )
+ a = settings.timeout()
+ assert( a.class == Fixnum )
+ assert( a == 5 )
+
+ # store a string
+ settings._store( "timeout", "35" )
+ a = settings.timeout()
+ assert( a.class == Fixnum )
+ assert( a == 35 )
+
+
+ end
+
end