Add test using native traits
Dave Rolsky [Wed, 20 Jan 2010 21:46:27 +0000 (15:46 -0600)]
t/04-with-native-traits.t [new file with mode: 0644]

diff --git a/t/04-with-native-traits.t b/t/04-with-native-traits.t
new file mode 100644 (file)
index 0000000..169cd95
--- /dev/null
@@ -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 );