diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
commit | 5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch) | |
tree | 298c3d2f08bdfe5689998b11892d72a897985be1 /t/roles/create_role_subclass.t | |
download | Moose-tarball-master.tar.gz |
Moose-2.1405HEADMoose-2.1405master
Diffstat (limited to 't/roles/create_role_subclass.t')
-rw-r--r-- | t/roles/create_role_subclass.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/roles/create_role_subclass.t b/t/roles/create_role_subclass.t new file mode 100644 index 0000000..c5795cb --- /dev/null +++ b/t/roles/create_role_subclass.t @@ -0,0 +1,26 @@ +use strict; +use warnings; +use Test::More; +use Moose (); + +do { + package My::Meta::Role; + use Moose; + extends 'Moose::Meta::Role'; + + has test_serial => ( + is => 'ro', + isa => 'Int', + default => 1, + ); + + no Moose; +}; + +my $role = My::Meta::Role->create_anon_role; +is($role->test_serial, 1, "default value for the serial attribute"); + +my $nine_role = My::Meta::Role->create_anon_role(test_serial => 9); +is($nine_role->test_serial, 9, "parameter value for the serial attribute"); + +done_testing; |