summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRene Mayorga <rmayorga@debian.org>2008-12-13 01:22:36 +0000
committerRene Mayorga <rmayorga@debian.org>2008-12-13 01:22:36 +0000
commiteab8f89c7f4938f08c97a9fdac1a082374ae7553 (patch)
tree8a2bf884fdea206c8722fb4692f138b38d81d93e /t
parentd174319d751440af21b1147fe0d0ca19a34b1359 (diff)
[svn-upgrade] Integrating new upstream version, libemail-abstract-perl (3.001)
Diffstat (limited to 't')
-rw-r--r--t/abstractions.t47
1 files changed, 27 insertions, 20 deletions
diff --git a/t/abstractions.t b/t/abstractions.t
index 9d97f6f..6e61b33 100644
--- a/t/abstractions.t
+++ b/t/abstractions.t
@@ -10,9 +10,9 @@ my @classes
= qw(Email::MIME Email::Simple MIME::Entity Mail::Internet Mail::Message);
plan tests => 2
- + (@classes * 2 + 1) * Test::EmailAbstract->tests_per_object
- + (@classes + 2) * Test::EmailAbstract->tests_per_class
- + 1;
+ + (@classes * 2 + 2) * Test::EmailAbstract->tests_per_object
+ + (@classes + 4) * Test::EmailAbstract->tests_per_class
+ + 2;
use_ok("Email::Abstract");
@@ -56,24 +56,31 @@ for my $class (@classes) {
}
}
-{
- my $email_abs = Email::Abstract->new($message);
- $tester->object_ok('plaintext', $email_abs, 0);
- $tester->class_ok('plaintext (class)', $message, 1);
-}
+for my $ref (0..1) {
+ my $get_msg = $ref
+ ? sub { my $copy = $message; \$copy }
+ : sub { $message };
+ my $desc = 'plaintext' . ($ref ? ' (ref)' : '');
-{
- my $email_abs = Email::Abstract->new($message);
- $tester->class_ok('Email::Abstract', $email_abs, 0);
-}
+ {
+ my $email_abs = Email::Abstract->new($get_msg->());
+ $tester->object_ok($desc, $email_abs, 0);
+ $tester->class_ok("$desc (class)", $get_msg->(), 1);
+ }
-{
- # Ensure that we can use Email::Abstract->header($abstract, 'foo')
- my $email_abs = Email::Abstract->new($message);
+ {
+ my $email_abs = Email::Abstract->new($get_msg->());
+ $tester->class_ok('Email::Abstract', $email_abs, 0);
+ }
+
+ {
+ # Ensure that we can use Email::Abstract->header($abstract, 'foo')
+ my $email_abs = Email::Abstract->new($get_msg->());
- my $email_abs_new = Email::Abstract->new($email_abs);
- ok(
- $email_abs == $email_abs_new,
- "trying to wrap a wrapper returns the wrapper; it doesn't re-wrap",
- );
+ my $email_abs_new = Email::Abstract->new($email_abs);
+ ok(
+ $email_abs == $email_abs_new,
+ "trying to wrap a wrapper returns the wrapper; it doesn't re-wrap",
+ );
+ }
}