### ----------------------------------------------------
### -- Collection
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth, aka finanalyst
### -- File: xt/55-dump.rakutest
### ----------------------------------------------------
use Test;
use Test::Deeply::Relaxed;
use File::Directory::Tree;

use Collection;
constant TMP = 'xt/test-dir';
constant MODE = 'test-mode';
constant PLUGS = "{MODE}/plugins";
constant CONFS = "{MODE}/configs";
constant TEMPLATES = "{MODE}/templates";
constant OUTPUT = "{MODE}/html";
constant REPORT = "{MODE}/reports";

plan 7;
my $rv;

bail-out "{TMP} and {TMP}/{ REPORT } must exist. Have report-completion tests been run?"
unless TMP.IO.d and "{TMP}/{ REPORT }".IO.d;

chdir TMP;
(PLUGS ~ '/completer/run-app.raku').IO.spurt( q:to/CODE/);
    sub ($destination, $landing, $ext, %plugin-options, %options) {
    }
    CODE
lives-ok {
    collect(:no-status, :full-render, :no-preserve-state, :dump-at(<source setup render compilation transfer report completion>)) ;
}, 'collect continues, but dumps';

for <setup render compilation transfer report completion> {
    ok "dumped-{MODE}-at-$_\.txt".IO.f, "dumped-{MODE}-at-$_\.txt".IO.absolute ~ ' is a dump file';
}

done-testing;


