From: Shawn M Moore Date: Thu, 30 Oct 2008 00:22:58 +0000 (+0000) Subject: Add a failing test for combination with MooseX::ClassAttribute X-Git-Tag: 0.16~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d0435088d92f7d9a0a8c3348e6cedc15e12acc4;p=gitmo%2FMooseX-AttributeHelpers.git Add a failing test for combination with MooseX::ClassAttribute MooseX::ClassAttribute depends on MooseX::AttributeHelpers, but I suspect the bug is in this code --- diff --git a/t/900_class_attribute.t b/t/900_class_attribute.t new file mode 100644 index 0000000..bb59dc3 --- /dev/null +++ b/t/900_class_attribute.t @@ -0,0 +1,28 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More tests => 2; + +do { + package TestClass; + BEGIN { + ::plan skip_all => "MooseX::ClassAttribute required for this test" + unless eval { + require MooseX::ClassAttribute; + MooseX::ClassAttribute->VERSION('0.05'); + }; + MooseX::ClassAttribute->import; + } + + class_has counter => ( + metaclass => 'Counter', + provides => { + inc => 'inc_counter', + }, + ); +}; + +is(TestClass->counter, 0); +TestClass->inc_counter; +is(TestClass->counter, 1); +