From: Shawn M Moore Date: Thu, 14 May 2009 04:45:47 +0000 (-0400) Subject: Tests for error conditions X-Git-Tag: 0.18_01~8^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a6837a2c705ec26b8dad7f49c2342f7c220cedb;p=gitmo%2FMooseX-AttributeHelpers.git Tests for error conditions --- diff --git a/t/003_basic_hash.t b/t/003_basic_hash.t index 79ca4cd..5f66998 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 => 45; +use Test::More tests => 48; use Test::Exception; BEGIN { @@ -131,6 +131,21 @@ dies_ok { Stuff->new(options => { foo => [] }); } '... bad constructor params'; +dies_ok { + my $stuff = Stuff->new; + $stuff->option_accessor(); +} '... accessor dies on 0 args'; + +dies_ok { + my $stuff = Stuff->new; + $stuff->option_accessor(1 => 2, 3); +} '... accessor dies on 3 args'; + +dies_ok { + my $stuff = Stuff->new; + $stuff->option_accessor(1 => 2, 3 => 4); +} '... accessor dies on 4 args'; + ## test the meta my $options = $stuff->meta->get_attribute('options');