|
From: <jgr...@us...> - 2003-07-26 17:32:30
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1:/tmp/cvs-serv4451/tests Modified Files: TestConfiguration.tst Log Message: Restore POPFile::Configuration test suite to 100% line coverage with test for load_configuration Index: TestConfiguration.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestConfiguration.tst,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestConfiguration.tst 15 Jul 2003 02:49:22 -0000 1.5 --- TestConfiguration.tst 26 Jul 2003 17:32:27 -0000 1.6 *************** *** 7,10 **** --- 7,12 ---- # --------------------------------------------------------------------------------------------- + unlink 'popfile.cfg'; + use POPFile::Configuration; use POPFile::MQ; *************** *** 65,69 **** test_assert( !$c->check_pid_() ); - # disable logging --- 67,70 ---- *************** *** 104,107 **** --- 105,143 ---- close STDERR; $c->stop(); + + # Check that the popfile.cfg was written + + open FILE, "<popfile.cfg"; + my $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_debug 0' ); + $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_download_count 0' ); + $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_msgdir messages/' ); + $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_subject 1' ); + $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_timeout 60' ); + $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_xpl 1' ); + $line = <FILE>; + test_assert_regexp( $line, 'GLOBAL_xtc 1' ); + $line = <FILE>; + test_assert_regexp( $line, 'config_piddir ../tests/' ); + $line = <FILE>; + test_assert_regexp( $line, 'logger_logdir ./' ); + $line = <FILE>; + test_assert_regexp( $line, 'testparam testvalue' ); + $line = <FILE>; + close FILE; + + # Now add a parameter and reload the configuration + + open FILE, ">>popfile.cfg"; + print FILE "testparam2 testvalue2\n"; + close FILE; + + $c->load_configuration(); + test_assert_equal( $c->parameter( 'testparam2' ), 'testvalue2' ); # Check that parameter upgrading works |