progress and WebGUI::Paths conversion

This commit is contained in:
Graham Knop 2010-02-23 10:06:50 -06:00
parent 90d63c6713
commit 29df110409
23 changed files with 63 additions and 333 deletions

View file

@ -13,7 +13,7 @@ use strict;
use lib "$FindBin::Bin/lib";
use WebGUI::Test;
use Test::More tests => 15; # increment this value for each test you create
use Test::More tests => 14; # increment this value for each test you create
use Test::Deep;
use File::Basename qw(basename);
@ -27,7 +27,6 @@ is( ref $config->get("macros"), "HASH", "get() macros hash" );
is( ref $config->get("assets"), "HASH", "get() assets hash" );
is( ref $config->get("shippingDrivers"), "ARRAY", "get() shippingDrivers array" );
is( $config->getFilename, basename($configFile), "getFilename()" );
is( $config->getWebguiRoot, $webguiRoot, "getWebguiRoot()" );
ok( defined WebGUI::Config->readAllConfigs($webguiRoot), "readAllConfigs" );
$config->addToArray("shippingDrivers","TEST");
my $found = 0;

View file

@ -13,6 +13,7 @@ use strict;
use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Paths;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Macro::Include;
@ -23,8 +24,8 @@ my $session = WebGUI::Test->session;
my $i18n = WebGUI::International->new($session, 'Macro_Include');
my $configFile = WebGUI::Test->root .'/etc/'. WebGUI::Test->file;
my $spectreConf = WebGUI::Test->root . '/etc/spectre.conf';
my $configFile = WebGUI::Paths->configBase . '/'. WebGUI::Test->file;
my $spectreConf = WebGUI::Paths->spectreConfig;
my $goodFile = 'The contents of this file are accessible';
my $twoLines = "This file contains two lines of text\nThis is the second line";

View file

@ -22,6 +22,7 @@ use MIME::Parser;
use Encode qw/decode encode/;
use WebGUI::Test;
use WebGUI::Paths;
use WebGUI::Mail::Send;
@ -134,7 +135,7 @@ SKIP: {
my $numtests = 2; # Number of tests in this block
# Must be able to write the config, or we'll die
if ( !-w File::Spec->catfile( WebGUI::Test::root, 'etc', WebGUI::Test::file() ) ) {
if ( !-w File::Spec->catfile( WebGUI::Paths->configBase, WebGUI::Test->file ) ) {
skip "Cannot test emailOverride: Can't write new configuration value", $numtests;
}

View file

@ -18,6 +18,7 @@ use Test::More;
use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Paths;
use WebGUI::Session;
use Spectre::Admin;
use WebGUI::Config;
@ -35,7 +36,7 @@ plan tests => 19;
$|++;
my $session = WebGUI::Test->session;
my $spectreConfigFile = WebGUI::Test->root . '/etc/spectre.conf';
my $spectreConfigFile = WebGUI::Paths->spectreConfig;
my $spectreConfig = Config::JSON->new($spectreConfigFile);
my $ip = $spectreConfig->get('ip');
my $port = $spectreConfig->get('port');

View file

@ -33,7 +33,7 @@ plan tests => 3; # Increment this number for each test you create
#----------------------------------------------------------------------------
# put your tests here
my $defaultConfigFile = Path::Class::File->new(WebGUI::Test->root, qw/etc WebGUI.conf.original/);
my $defaultConfigFile = Path::Class::File->new(WebGUI::Paths->configBase, 'WebGUI.conf.original');
ok (-e $defaultConfigFile->stringify, 'WebGUI.conf.original exists');