From: Shawn M Moore Date: Sun, 25 May 2008 01:03:12 +0000 (+0000) Subject: Test the metaclass in t/003_basic_hash X-Git-Tag: 0.16~62 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=321ab9fe187960ca974c3a76f87b7b08270c032b;p=gitmo%2FMooseX-AttributeHelpers.git Test the metaclass in t/003_basic_hash --- diff --git a/t/003_basic_hash.t b/t/003_basic_hash.t index 24a6b3f..95fd8f7 100644 --- a/t/003_basic_hash.t +++ b/t/003_basic_hash.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 32; +use Test::More tests => 35; use Test::Exception; BEGIN { @@ -107,4 +107,18 @@ dies_ok { Stuff->new(options => { foo => [] }); } '... bad constructor params'; +## test the meta +my $options = $stuff->meta->get_attribute('options'); +isa_ok($options, 'MooseX::AttributeHelpers::Collection::Hash'); + +is_deeply($options->provides, { + 'set' => 'set_option', + 'get' => 'get_option', + 'empty' => 'has_options', + 'count' => 'num_options', + 'clear' => 'clear_options', + 'delete' => 'delete_option', +}, '... got the right provies mapping'); + +is($options->type_constraint->type_parameter, 'Str', '... got the right container type');