File: fail.t

package info (click to toggle)
libemail-sender-perl 2.601-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 468 kB
  • sloc: perl: 2,276; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (6)
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
#!perl
use strict;
use warnings;
use Test::More tests => 5;

use Email::Sender::Failure;

{
  my $fail = Email::Sender::Failure->new("message");
  isa_ok($fail, 'Email::Sender::Failure');
  is($fail->message, 'message', 'string alone -> message');
}

{
  eval { my $fail = Email::Sender::Failure->new(undef); };
  like($@, qr/Missing required arguments: message/, '->new(undef) -> fail');
}

{
  eval { my $fail = Email::Sender::Failure->new(''); };
  like($@, qr/must be a hash ref/i, '->new("") -> fail');
}

{
  eval { my $fail = Email::Sender::Failure->new(message => ''); };
  like($@, qr/message/i, '->new(message=>"") -> fail');
}