File: no-body.t

package info (click to toggle)
libemail-simple-perl 2.218-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 336 kB
  • sloc: perl: 462; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 484 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use v5.12.0;
use warnings;

use Test::More tests => 5;

# This time, with folding!

use_ok("Email::Simple");
sub read_file { local $/; local *FH; open FH, shift or die $!; return <FH> }

for ('', '-blank') {
  my $mail_text = read_file("t/test-mails/josey-nobody$_");

  my $mail = Email::Simple->new($mail_text);
  isa_ok($mail, "Email::Simple");

  is(
    $mail->header('From'),
    'Andrew Josey <ajosey@rdg.opengroup.org>',
    'correct From header on bodyless message',
  );
}