added diagnostics for failed spool_dir test

likely due to config caching
This commit is contained in:
Matt Simerson 2014-09-15 23:58:55 -07:00
parent ebdb25a4bd
commit 75cb416b62

View File

@ -2,6 +2,7 @@
use strict; use strict;
use warnings; use warnings;
use Cwd;
use Data::Dumper; use Data::Dumper;
use File::Path; use File::Path;
use Test::More; use Test::More;
@ -13,7 +14,6 @@ BEGIN {
use_ok('Qpsmtpd'); use_ok('Qpsmtpd');
use_ok('Qpsmtpd::Constants'); use_ok('Qpsmtpd::Constants');
use_ok('Test::Qpsmtpd'); use_ok('Test::Qpsmtpd');
} }
my $qp = bless {}, 'Qpsmtpd'; my $qp = bless {}, 'Qpsmtpd';
@ -67,16 +67,17 @@ sub __load_logging {
sub __spool_dir { sub __spool_dir {
my $dir = $qp->spool_dir(); my $dir = $qp->spool_dir();
ok( $dir, "spool_dir is at $dir"); ok($dir, "spool_dir is at $dir");
my $cwd = `pwd`; my $cwd = getcwd;
chomp($cwd); chomp $cwd;
open my $spooldir, '>', "./config.sample/spool_dir"; open my $SD, '>', "./config.sample/spool_dir";
print $spooldir "$cwd/t/tmp"; print $SD "$cwd/t/tmp";
close $spooldir; close $SD;
my $spool_dir = $smtpd->spool_dir(); my $spool_dir = $smtpd->spool_dir();
ok($spool_dir =~ m!t/tmp/$!, "Located the spool directory"); ok($spool_dir =~ m!/tmp/$!, "Located the spool directory")
or diag ("spool_dir: $spool_dir instead of tmp");
my $tempfile = $smtpd->temp_file(); my $tempfile = $smtpd->temp_file();
my $tempdir = $smtpd->temp_dir(); my $tempdir = $smtpd->temp_dir();