### ----------------------------------------------------
### -- Pod::From::Cache
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth, aka finanalyst
### -- File: xt/60-ignore-file.rakutest
### ----------------------------------------------------
use Test;
use File::Directory::Tree;

constant CACHE = 'xt/cache';
constant DOC = 'xt/doctest';

use Pod::From::Cache;

rmtree CACHE;

my $fn = DOC ~ '/.ignore-cache';
$fn.IO.spurt(q:to/IGNORE/);
    # a comment
    contexts.pod6
    IGNORE

my Pod::From::Cache $m .= new( :doc-source( DOC ), :cache-path( CACHE ));
my $h = $m.sources.SetHash;
ok $h<xt/doctest/community.pod6 xt/doctest/operators.pod6 xt/doctest/simple.pod6 xt/doctest/sub/simple.pod6 >, 'contexts.pod6 is ignored';

is $m.pod( DOC ~ '/contexts.pod6' ) , Nil, 'Ignored files get Nil returned';

#$fn.IO.unlink;

#leave cache for next tests
#rmtree CACHE;

done-testing;


