use temp config file for testing
This commit is contained in:
parent
bc5df47fed
commit
6f102973dd
20 changed files with 56 additions and 95 deletions
|
|
@ -14,6 +14,7 @@ use lib "$FindBin::Bin/../lib";
|
|||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::AdSpace;
|
||||
use WebGUI::AdSpace::Ad;
|
||||
|
||||
use Test::More;
|
||||
use Test::Deep;
|
||||
|
|
@ -38,12 +39,9 @@ my $newAdSettings = {
|
|||
|
||||
my $numTests = 33; # increment this value for each test you create
|
||||
$numTests += scalar keys %{ $newAdSettings };
|
||||
++$numTests; ##For conditional testing on module load
|
||||
|
||||
plan tests => $numTests;
|
||||
|
||||
my $loaded = use_ok('WebGUI::AdSpace::Ad');
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
my $ad;
|
||||
my ($richAd, $textAd, $imageAd, $nonAd, $setAd);
|
||||
|
|
@ -52,10 +50,6 @@ my $imageStorage = WebGUI::Storage->create($session);
|
|||
WebGUI::Test->addToCleanup($imageStorage);
|
||||
$imageStorage->addFileFromScalar('foo.bmp', 'This is not really an image');
|
||||
|
||||
SKIP: {
|
||||
|
||||
skip "Unable to load WebGUI::AdSpace::Ad", $numTests-1 unless $loaded;
|
||||
|
||||
local $ENV{REMOTE_ADDR} = '10.0.0.1';
|
||||
local $ENV{HTTP_USER_AGENT} = 'Mozilla/5.0';
|
||||
|
||||
|
|
@ -209,8 +203,6 @@ SKIP: {
|
|||
is($setAd->get('url'), '', 'set: clearing url');
|
||||
is($setAd->get('adText'), '', 'set: clearing adText');
|
||||
|
||||
}
|
||||
|
||||
END {
|
||||
foreach my $advertisement ($ad, $richAd, $textAd, $imageAd, $nonAd, $setAd) {
|
||||
if (defined $advertisement and ref $advertisement eq 'WebGUI::AdSpace::Ad') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue