From cdc739a4bc2ad25f110ec446188f36c5ab2f68b6 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 12 Dec 2012 14:20:24 +0000 Subject: Added simple is-singleton test. --- t/test-custodian-settings.rb | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 t/test-custodian-settings.rb (limited to 't') diff --git a/t/test-custodian-settings.rb b/t/test-custodian-settings.rb new file mode 100755 index 0000000..a39b545 --- /dev/null +++ b/t/test-custodian-settings.rb @@ -0,0 +1,41 @@ +#!/usr/bin/ruby1.8 -I./lib/ -I../lib/ + + +require 'custodian/settings' +require 'test/unit' + + + +# +# Unit test for our configuration file reader. +# +# +class TestConfigurationSingleton < Test::Unit::TestCase + + # + # Create the test suite environment: NOP. + # + def setup + end + + # + # Destroy the test suite environment: NOP. + # + def teardown + end + + + # + # Test that we're genuinely a singleton + # + def test_singleton + a = Custodian::Settings.instance() + b = Custodian::Settings.instance() + + assert( a ) + assert( b ) + assert_equal( a.object_id, b.object_id ) + end + + +end -- cgit v1.2.1