From a9f44b3c7aecc38e6eab702f22332e0da626cef3 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 15 May 2013 13:00:17 +0100 Subject: Updated to test types of integer values. --- t/test-custodian-settings.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 't') 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 -- cgit v1.2.1