Failing test for an unparameterized method
Shawn M Moore [Sun, 7 Dec 2008 01:06:52 +0000 (01:06 +0000)]
t/014-compose-parameterizable.t [new file with mode: 0644]

diff --git a/t/014-compose-parameterizable.t b/t/014-compose-parameterizable.t
new file mode 100644 (file)
index 0000000..4423fe4
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+do {
+    package MyRole;
+    use MooseX::Role::Parameterized;
+
+    parameter attribute => (
+        is  => 'ro',
+        isa => 'Str',
+    );
+
+    sub meth { 1 }
+
+    role {
+        my $p = shift;
+
+        has $p->attribute => (
+            is => 'ro',
+        );
+    };
+};
+
+do {
+    package MyClass;
+    use Moose;
+    with 'MyRole' => {
+        attribute => 'attr',
+    };
+};
+
+ok(MyClass->can('attr'), "the parameterized attribute was composed");
+ok(MyClass->can('meth'), "the unparameterized method was composed");
+