### ----------------------------------------------------
### -- Raku::Pod::Render
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth
### -- File: xt/901-html/85-custom-block.rakutest
### ----------------------------------------------------
use v6.*;
use Test;

use Pod::To::HTML2;
my $rv;
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('images',) );
my $pc = 0;

plan 2;

=begin pod

=for Image

Some POD

=end pod

$rv = $processor.render-block($=pod[$pc++]);

like $rv, /
    '<img src="path/to/image" width="100px" height="auto" alt="No caption">'
    /, 'image with dummy entries';

=begin pod

=for Image :alt<Alt expression> :width<120px> :height<100px> :src<asset/image.png>

Some POD

=end pod

$rv = $processor.render-block($=pod[$pc]);

like $rv, /
'<img src="asset/image.png" width="120px" height="100px" alt="Alt expression">'
/, 'image as required';

done-testing;


