$ cat t/01-test-mod.t use strict; use utf8; use warnings; use FindBin; use File::Spec; use Test::More; use Test::Exception; use PDF::PDFUnit qw(:skip_on_error); my $resources_dir = File::Spec->catfile($FindBin::Bin, 'resources'); my $pdfReference = "$resources_dir/reference.pdf"; lives_ok { AssertThat ->document($pdfReference) ->hasText() ->containing("Hello") } "containing Hello"; lives_ok { AssertThat ->document($pdfReference) ->hasText() ->notContaining("Hello") } "notContaining Hello"; diag $@->getMessage() if $@; done_testing(); __END__ $ perl t/01-test-mod.t ok 1 - containing Hello ok 2 - notContaining Hello 1..2 $