### ----------------------------------------------------
### -- Raku::Pod::Render
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth
### -- File: xt/901-html/80-lang-pathname.rakutest
### ----------------------------------------------------
use v6;
use Test;
use Pod::To::HTML2;
my $def-dir = 'xt/test-def'.IO;
my $tar-dir = 'xt/tar-dir'.IO;

bail-out "Requires $def-dir and $tar-dir" unless ($def-dir ~~ :e and $tar-dir ~~ :e);
chdir ~$tar-dir;

my $processor = Pod::To::HTML2.new(:$def-dir, :plugins() );
my $rv;
plan 3;

=begin pod

Je suis Napoleon!

=end pod
$processor.no-meta = $processor.no-footnotes = $processor.no-glossary = $processor.no-toc = True;
$processor.process-pod( $=pod[0] );

like $processor.source-wrap, /'<html lang="en">'/, 'default lang is English';
$processor.pod-file.lang = 'fr';
$processor.process-pod( $=pod[0] );
like $processor.source-wrap, /'<html lang="fr">'/, 'custom lang';

$processor.pod-file.path = 'lang/name-test';
$processor.process-pod( $=pod[0] );
$rv = $processor.source-wrap;
like $rv,
         /
         'Rendered from'
         .+ 'name-test'
         /, 'path changed';

done-testing


