X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F05-with-attribute-helpers-backcompat.t;fp=t%2F05-with-attribute-helpers-backcompat.t;h=9d757f6902114f7abd3a93bf8f54b83382e5de60;hb=9924122d4207e10a10a4c8b7afe0afb4bc7ff065;hp=0000000000000000000000000000000000000000;hpb=2a97dc96376f58b16f199d490601b0bd51751dae;p=gitmo%2FMooseX-ClassAttribute.git 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();