From: Shawn M Moore Date: Sun, 14 Dec 2008 22:09:07 +0000 (+0000) Subject: Tests for parameterized metaclass traits X-Git-Tag: 0.64~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea505fce9d5229f0b2a90addb2fbb70d0f756c96;p=gitmo%2FMoose.git Tests for parameterized metaclass traits --- diff --git a/Changes b/Changes index 1f25479..4e1e886 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ Revision history for Perl extension Moose - Always inline predicate and clearer methods (Sartak) * Moose::Meta::Attribute - Support for parameterized traits (Sartak) + * Moose::Meta::Class + - Tests (but no support yet) for parameterized traits (Sartak) 0.63 Mon, December 8, 2008 * Moose::Unsweetened diff --git a/t/050_metaclasses/020_metaclass_parameterized_traits.t b/t/050_metaclasses/020_metaclass_parameterized_traits.t new file mode 100644 index 0000000..cd6e5ad --- /dev/null +++ b/t/050_metaclasses/020_metaclass_parameterized_traits.t @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More skip_all => "Feature not implemented yet"; +#use Test::More tests => 1; + +{ + package My::Trait; + use Moose::Role; + + sub reversed_name { + my $self = shift; + scalar reverse $self->name; + } +} + +{ + package My::Class; + use Moose -traits => [ + 'My::Trait' => { + alias => { + reversed_name => 'enam', + }, + }, + ]; +} + +is(My::Class->meta->enam, 'ssalC::yM', 'parameterized trait applied'); +