diff options
author | Ricardo Signes <rjbs@cpan.org> | 2006-07-18 23:09:50 +0000 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2006-07-18 23:09:50 +0000 |
commit | fe291af538666b24e70299d70c133346dee7d297 (patch) | |
tree | c102916131d58dc3704043afb96c3a65acc0bc05 /t | |
parent | 54befe9be61a4710a62edf5a6bc5aa41d8838c4b (diff) |
r23488@knight: rjbs | 2006-07-18 18:41:16 -0400
abstract objects that wrap concrete objects
Diffstat (limited to 't')
-rw-r--r-- | t/classy.t (renamed from t/1.t) | 0 | ||||
-rw-r--r-- | t/subclass.t | 15 |
2 files changed, 10 insertions, 5 deletions
diff --git a/t/subclass.t b/t/subclass.t index 697bc73..f2af01d 100644 --- a/t/subclass.t +++ b/t/subclass.t @@ -1,13 +1,18 @@ -package MyMail; -use base "Email::Simple"; -1; +{ + package MyMail; + use base "Email::Simple"; +} package main; -use Test::More tests => 1; +use Test::More tests => 3; use Email::Abstract; my $message = do { local $/; <DATA>; }; my $x = MyMail->new($message); -like (Email::Abstract->as_string($x), qr/Farley's/, "Round trip with subclass"); +like(Email::Abstract->as_string($x), qr/Farley's/, "Round trip with subclass"); + +my $y = Email::Abstract->new($x); +isa_ok($y, 'Email::Abstract'); +like($y->as_string, qr/Farley's/, "Round trip subclass via object wrapped"); __DATA__ Received: from mailman.opengroup.org ([192.153.166.9]) |