From: Shawn M Moore Date: Sun, 25 May 2008 01:09:06 +0000 (+0000) Subject: Test the bag's meta X-Git-Tag: 0.16~60 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35758b1cec5f148596b418998f91e8542f272c87;p=gitmo%2FMooseX-AttributeHelpers.git Test the bag's meta --- diff --git a/t/006_basic_bag.t b/t/006_basic_bag.t index a90bbc9..ad5ae6c 100644 --- a/t/006_basic_bag.t +++ b/t/006_basic_bag.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 18; +use Test::More tests => 20; use Test::Exception; BEGIN { @@ -61,5 +61,16 @@ is($stuff->get_count_for('foo'), 1, '... got words now'); is($stuff->get_count_for('bar'), 5, '... got words now'); is($stuff->get_count_for('baz'), 11, '... got words now'); +## test the meta +my $words = $stuff->meta->get_attribute('word_histogram'); +isa_ok($words, 'MooseX::AttributeHelpers::Collection::Bag'); + +is_deeply($words->provides, { + 'add' => 'add_word', + 'get' => 'get_count_for', + 'empty' => 'has_any_words', + 'count' => 'num_words', + 'delete' => 'delete_word', +}, '... got the right provides mapping');