From: Dave Rolsky Date: Wed, 20 Jan 2010 21:48:01 +0000 (-0600) Subject: Make MX::AH optional X-Git-Tag: 0.11~33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9924122d4207e10a10a4c8b7afe0afb4bc7ff065;p=gitmo%2FMooseX-ClassAttribute.git Make MX::AH optional --- diff --git a/t/05-with-attribute-helpers-backcompat.t b/t/05-with-attribute-helpers-backcompat.t new file mode 100644 index 0000000..9d757f6 --- /dev/null +++ b/t/05-with-attribute-helpers-backcompat.t @@ -0,0 +1,31 @@ +use strict; +use warnings; + +use Test::More; + +BEGIN { + eval "use MooseX::AttributeHelpers 0.13;"; + plan skip_all => 'This test requires MooseX::AttributeHelpers 0.13+' + if $@; +} + +{ + package MyClass; + + use MooseX::ClassAttribute; + use MooseX::AttributeHelpers; + + class_has counter => + ( metaclass => 'Counter', + is => 'ro', + provides => { inc => 'inc_counter', + }, + ); +} + +is( MyClass->counter(), 0 ); + +MyClass->inc_counter(); +is( MyClass->counter(), 1 ); + +done_testing();