Thread [Tests] Dateien im ./t-Ordner (6 answers)
Opened by pktm at 2011-04-13 21:22

pktm
 2011-04-25 08:20
#147949 #147949
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
Ich habe es jetzt mal so gemacht:

Code: (dl )
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
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl MIME-Lite-HT-HTML.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test;
BEGIN { plan tests => 2 };
use MIME::Lite::HT::HTML;
ok(1); # If we made it this far, we're ok.

my $msg = MIME::Lite::HT::HTML->new(
From => 'from@example.com',
To => 'to@example.com',
Subject => 'Subject',
TimeZone => 'Europe/Berlin',
Encoding => 'quoted-printable',
Template => {
html => './t/data/mail.html',
text => './t/data/mail.txt',
},
Charset => 'utf8',
);
ok(1, 1, 'Could not instantiate MIME::Lite::HT::HTML without any options or params');

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.


Meinst Du, das ist so ok? Der Test läuft zumindest durch. Ich habe allerdings Bedenken wegen der relativen Pfadangabe: ./t/data/mail.html. Ist man bei der Modul-Installation denn immer im Verzeichnis des Moduls, wo alle Dateien entpackt werden?
http://www.intergastro-service.de (mein erstes CMS :) )

View full thread [Tests] Dateien im ./t-Ordner