### ----------------------------------------------------
### -- Raku::Pod::Render
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth
### -- File: xt/25-detect-templater.rakutest
### ----------------------------------------------------
use v6.d;
use Test;
use ProcessedPod;
use RenderPod::Templating;
plan 7;
skip-rest 'waiting til Crotmp templates can be used';

#
#my ProcessedPod $processor .= new;
#
#my @templates = SetupTemplates.new.required;

#
## test for Cro Templates
#my %templates = @templates Z=> ( "\[beg]<.contents>$_\[end]" for @templates );
#lives-ok { $processor.templates(%templates) }, 'loads templates';
#isa-ok $processor.templater, 'CroTemplater', 'auto-detects Cro templater';
#
#$processor .= new;
#%templates<_templater> = 'NotKnownTemplater';
#throws-like { $processor.templates(%templates) }, X::ProcessedPod::UnknownTemplatingEngine,
#        message => / 'Can\'t create template engine ｢NotKnownTemplater｣' /,
#        'Catches unknown templater';
#
#$processor .= new;
#%templates<_templater> = 'CroTemplater';
#lives-ok { $processor.templates(%templates) }, 'loads templates';
#isa-ok $processor.templater, 'CroTemplater', 'auto-detects Cro templater';
#
#$processor .= new;
#%templates<_templater> = 'MustacheTemplater';
#lives-ok { $processor.templates(%templates) }, 'loads templates';
#isa-ok $processor.templater, 'MustacheTemplater', '_templater key overides autodetection';

done-testing


