help the test track changes to Config.pm and how it handles paths

This commit is contained in:
Colin Kuskie 2008-09-30 16:11:11 +00:00
parent a61bd107fa
commit 7043f5d711

View file

@ -30,6 +30,7 @@ our ( $SESSION, $WEBGUI_ROOT, $CONFIG_FILE, $WEBGUI_LIB, $WEBGUI_TEST_COLLATERAL
use Config qw[];
use IO::Handle qw[];
use File::Spec qw[];
use Cwd qw[];
use Test::MockObject::Extends;
use WebGUI::PseudoRequest;
use Scalar::Util qw( blessed );
@ -83,10 +84,12 @@ BEGIN {
unless ( File::Spec->file_name_is_absolute($WEBGUI_ROOT) ) {
$WEBGUI_ROOT = File::Spec->rel2abs($WEBGUI_ROOT);
}
warn $WEBGUI_ROOT."\n";
$CONFIG_FILE = ( File::Spec->splitpath( $WEBGUI_ROOT ) )[2];
$WEBGUI_ROOT = substr( $WEBGUI_ROOT, 0, index( $WEBGUI_ROOT, File::Spec->catdir( 'etc', $CONFIG_FILE ) ) );
$WEBGUI_ROOT = File::Spec->canonpath($WEBGUI_ROOT);
$WEBGUI_ROOT = Cwd::realpath($WEBGUI_ROOT);
$WEBGUI_TEST_COLLATERAL = File::Spec->catdir($WEBGUI_ROOT, 't', 'supporting_collateral');
my ($volume,$directories) = File::Spec->splitpath( $WEBGUI_ROOT, 'no_file' );