Add failing tests for AttributeHelpers + ClassAttribute
Shawn M Moore [Mon, 10 Nov 2008 22:23:22 +0000 (22:23 +0000)]
t/04-with-attribute-helpers.t [new file with mode: 0644]

diff --git a/t/04-with-attribute-helpers.t b/t/04-with-attribute-helpers.t
new file mode 100644 (file)
index 0000000..e1cf84a
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+do {
+    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);
+