File: gravatar-error.t

package info (click to toggle)
libtemplate-plugin-gravatar-perl 0.10-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 212 kB
  • sloc: perl: 2,242; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!perl
use Template::Test;
$Template::Test::DEBUG = 1;

test_expect( \*DATA );

__DATA__
-- test --
[% USE Gravatar -%]
loaded

-- expect --
loaded

-- test --
[% USE Gravatar -%]
[% TRY %][% Gravatar %][% CATCH %][% error.info.replace('\s+at\s.+','') %][% END %]

-- expect --
Cannot generate a Gravatar URI without an email address

-- test --
[% USE Gravatar -%]
[% TRY %][% Gravatar(email => 'x', rating => 'NC-17') %][% CATCH %][% error.info.replace('\s+at\s.+','') %][% END %]

-- expect --
Gravatar rating can only be G, PG, R, or X

-- test --
[% USE Gravatar( size => 2049 ) -%]
[% TRY %][% Gravatar(email => 'x') %][% CATCH %][% error.info.replace('\s+at\s.+','') %][% END %]

-- expect --
Gravatar size must be 1 .. 2048