From: Shawn M Moore Date: Sun, 7 Dec 2008 01:29:56 +0000 (+0000) Subject: Failing test for passing parameters to role->create (fix will go in Class::MOP) X-Git-Tag: 0.63~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3d8de5a6ae48a92c2d0993f61e51a467984c4e1;p=gitmo%2FMoose.git Failing test for passing parameters to role->create (fix will go in Class::MOP) --- diff --git a/t/030_roles/037_create_role_subclass.t b/t/030_roles/037_create_role_subclass.t new file mode 100644 index 0000000..ff436f6 --- /dev/null +++ b/t/030_roles/037_create_role_subclass.t @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More tests => 2; +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"); +