File: 08-teapot.t

package info (click to toggle)
libhttp-exception-perl 0.04007-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 300 kB
  • sloc: perl: 232; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 425 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;

use Test::More;
use HTTP::Exception;

# GitHub PR#4 - eval fails silently for HTTP 418

my @teapots = (
    HTTP::Exception->new(418),
    HTTP::Exception::418->new(),
    HTTP::Exception::I_AM_A_TEAPOT->new(),
);

plan tests => scalar @teapots * 2;

for my $e (@teapots) {
    is  $e->status_message, q~I'm a teapot~, 'status_message accessor exists';
    is  $e->code,           418, 'code accessor exists';
}