App-CopyrightImage

 view release on metacpan or  search on metacpan

t/05-api.t  view on Meta::CPAN

    $o->unhook;
    is $@, '', "doesn't die with no name with check";
}

{ # check single no-copy
    $o->flush;
    $o->hook;
    imgcopyright(src => $t->base, name => 'steve', check => 1);
    $o->unhook;

    is $o->stderr, 0, "no error output on check with no exif"; 

    my @out = $o->stdout;
    is $o->stdout, 1, "proper warning for single img w/no exif";
    like $out[0], qr/Copyright/, "single w/no exif Copyright ok";
    like $out[0], qr/Creator/, "single w/no exif Creator ok";
}
{ # check copy and no-copy
    $o->flush;
    $o->hook;
    imgcopyright(src => $t->build, name => 'steve', check => 1);
    $o->unhook;

    is $o->stderr, 0, "no error output on check with no exif"; 

    my @out = $o->stdout;
    is @out, 1, "proper warning for single img w/no exif";
    like $out[0], qr/Copyright/, "good/bad w/no exif Copyright ok";
    like $out[0], qr/Creator/, "good/bad w/no exif Creator ok";
}

done_testing();



( run in 0.524 second using v1.01-cache-2.11-cpan-49f99fa48dc )