Added WebGUI::Test and updated t/Config.t
This commit is contained in:
parent
76ef4da780
commit
3f6176397b
2 changed files with 95 additions and 24 deletions
39
t/Config.t
39
t/Config.t
|
|
@ -8,31 +8,22 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use strict;
|
||||
use lib '../lib';
|
||||
use Getopt::Long;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
use WebGUI::Config;
|
||||
use strict;
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use Test::More tests => 6; # increment this value for each test you create
|
||||
|
||||
$|=1;
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
|
||||
my $config = WebGUI::Config->new("..", $configFile);
|
||||
|
||||
ok(defined $config, "load config");
|
||||
ok($config->get("dsn") ne "", "get()");
|
||||
is($config->getFilename,$configFile,"getFilename()");
|
||||
is($config->getWebguiRoot, "..", "getWebguiRoot()");
|
||||
WebGUI::Config->loadAllConfigs("..");
|
||||
ok(exists $WebGUI::Config::config{$configFile}, "loadAllConfigs");
|
||||
ok(defined WebGUI::Config->readAllConfigs(".."), "readAllConfigs");
|
||||
|
||||
|
||||
my $config = WebGUI::Test->config;
|
||||
my $configFile = WebGUI::Test->file;
|
||||
my $webguiRoot = WebGUI::Test->root;
|
||||
|
||||
ok( defined $config, "load config" );
|
||||
ok( $config->get("dsn") ne "", "get()" );
|
||||
is( $config->getFilename,$configFile,"getFilename()" );
|
||||
is( $config->getWebguiRoot, $webguiRoot, "getWebguiRoot()" );
|
||||
ok( exists $WebGUI::Config::config{$configFile}, "loadAllConfigs" );
|
||||
ok( defined WebGUI::Config->readAllConfigs($webguiRoot), "readAllConfigs" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue