From: Shawn M Moore Date: Sun, 9 Nov 2008 04:44:24 +0000 (+0000) Subject: Begin writing tests X-Git-Tag: 0.05~100 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=753682d43dafd84a4f0608c87cfcc1af5f219c64;p=gitmo%2FMooseX-Role-Parameterized.git Begin writing tests --- diff --git a/t/002-role-block.t b/t/002-role-block.t new file mode 100644 index 0000000..f1d633e --- /dev/null +++ b/t/002-role-block.t @@ -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); +