#!perl

use strict;
use warnings;
use Test::More tests => 4;

use Pod::Advent;

chdir 'ex';

my $advent = Pod::Advent->new;
isa_ok($advent, 'Pod::Advent');
my $s;
$advent->output_string( \$s );
$advent->parse_file( 'getting_started.pod' );

my $html = do{ local $/ = undef; open FILE, '<', 'getting_started.html'; <FILE> };

# Strip the 'Generated by' line before comparison, since that line is time- and system-dependent.
s/^<!-- Generated by Pod::Advent .+? -->$//m for $html, $s;

is($s, $html, "file matches!");

is( $advent->num_spelling_errors, 0, "misspelled word ct" );
is_deeply( [ $advent->spelling_errors ], [], "misspelled words" );

