Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

PDF::PDFUnit notContaining

by andreas1234567 (Vicar)
on Feb 16, 2017 at 21:51 UTC ( #1182172=perlquestion: print w/replies, xml ) Need Help??

andreas1234567 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

PDF::PDFUnit let's us verify PDF documents using perl. It seems to do a good job, except for the notContaining function. It seems to always return true (here a rewritten version of 01-load.t). The basic idea is to detect presence of unwanted words, such as the name of the former CEO:

$ 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 $
Do anyone have experience with this module?

openjdk-8-jre:amd64 + Ubuntu 16.04.1 LTS + perl v5.22.1


No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1182172]
Approved by stevieb
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-01-28 06:37 GMT
Find Nodes?
    Voting Booth?