From: gfx Date: Fri, 14 Aug 2009 00:34:38 +0000 (+0900) Subject: Add tests for "use Moose -extends => [@superclasses]". X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63908f5a65814aea32c40fbbafb298798bea58d7;p=gitmo%2FMoose.git Add tests for "use Moose -extends => [@superclasses]". --- diff --git a/t/010_basics/023_extends_command.t b/t/010_basics/023_extends_command.t new file mode 100755 index 0000000..72f0c1a --- /dev/null +++ b/t/010_basics/023_extends_command.t @@ -0,0 +1,39 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 7; +use Test::Exception; + +ok(T3->isa('T1'), 'extablish is-a relationship at compile-time'); + +{ + package T1; + use Moose -extends => []; +} + +{ + package T2; + use Moose -extends => [qw(T1)]; +} + +{ + package T3; + use Moose -extends => 'T2'; +} + +lives_and { + isa_ok(T1->new, 'T1'); +}; + +lives_and { + isa_ok(T2->new, 'T1'); + isa_ok(T2->new, 'T2'); +}; + +lives_and { + isa_ok(T3->new, 'T1'); + isa_ok(T3->new, 'T2'); + isa_ok(T3->new, 'T3'); +};