From: Dave Rolsky Date: Wed, 20 Jan 2010 21:46:27 +0000 (-0600) Subject: Add test using native traits X-Git-Tag: 0.11~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed10982f688373a6b2889602dcbd84a2ae444cfb;p=gitmo%2FMooseX-ClassAttribute.git Add test using native traits --- diff --git a/t/04-with-native-traits.t b/t/04-with-native-traits.t new file mode 100644 index 0000000..169cd95 --- /dev/null +++ b/t/04-with-native-traits.t @@ -0,0 +1,23 @@ +use strict; +use warnings; + +use Test::More tests => 2; + +{ + package MyClass; + + use MooseX::ClassAttribute; + + class_has counter => ( + traits => ['Counter'], + is => 'ro', + handles => { + inc_counter => 'inc', + }, + ); +} + +is( MyClass->counter(), 0 ); + +MyClass->inc_counter(); +is( MyClass->counter(), 1 );