Acme-Cavaspazi

 view release on metacpan or  search on metacpan

t/01_hello.t  view on Meta::CPAN

mkdir $dirname or die "Can't mkdir $dirname: $!";

my @cmd = ($^X, $bin, '-r', '--verbose', $dirname, $filename);
print STDERR "Running command: @cmd\n";
ok(-e $filename, "File $filename exists");
ok(-e $dirname, "Directory $dirname exists");

my $exit = system(@cmd);
ok($exit == 0, "Command @cmd exited with 0");

my @files = glob("$tempdir/*");
for my $file (@files) {
    ok(!($file =~ / /), "File $file does not contain spaces");
}

done_testing();

t/02_world.t  view on Meta::CPAN

print $fh "Hello, world!\nThere are spaces in this file.\n";
close $fh;

my @cmd = ($^X, $bin, '-s', '--verbose', $filename);

ok(-e $filename, "File $filename exists");

my $exit = system(@cmd);
ok($exit == 0, "Command @cmd exited with 0");

my @files = glob("$tempdir/*");
for my $file (@files) {
    open my $fh, '<', $file or die "Can't open $file: $!";
    my $content = do { local $/; <$fh> };
    close $fh;
    ok(($content !~ / /), "File $file does not contain spaces: $content");
}

done_testing();



( run in 0.671 second using v1.01-cache-2.11-cpan-49f99fa48dc )