Begin writing tests
Shawn M Moore [Sun, 9 Nov 2008 04:44:24 +0000 (04:44 +0000)]
t/002-role-block.t [new file with mode: 0644]

diff --git a/t/002-role-block.t b/t/002-role-block.t
new file mode 100644 (file)
index 0000000..f1d633e
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 2;
+use Test::Exception;
+
+my ($parameters, %args);
+
+do {
+    package MyRole;
+    use MooseX::Role::Parameterized;
+
+    parameter length => (
+        is       => 'rw',
+        isa      => 'Int',
+        required => 1,
+    );
+
+    role {
+        ($parameters, %args) = @_;
+    };
+};
+
+ok(MyRole->meta->has_role_generator, "MyRole has a role generator");
+
+my $role = MyRole->meta->generate_role(
+    length => 7,
+);
+
+isa_ok($role, 'Moose::Meta::Role', 'generate_role created a role');
+
+is($parameters->length, 7);
+