From: Dave Rolsky Date: Sun, 14 Dec 2008 23:22:49 +0000 (+0000) Subject: Add tests that various setting methods do proper type checking X-Git-Tag: 0.16~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b380a526ab2241f203061beec3b6fef0af9247a;hp=8ba9223461d20f3978f61c367b5fe57fa963e335;p=gitmo%2FMooseX-AttributeHelpers.git Add tests that various setting methods do proper type checking --- diff --git a/t/002_basic_array.t b/t/002_basic_array.t index 8aab0a4..1153247 100644 --- a/t/002_basic_array.t +++ b/t/002_basic_array.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 52; +use Test::More tests => 55; use Test::Exception; BEGIN { @@ -148,6 +148,21 @@ dies_ok { Stuff->new(options => [ undef, 10, undef, 20 ]); } '... bad constructor params'; +dies_ok { + my $stuff = Stuff->new(); + $stuff->add_options(undef); +} '... rejects push of an invalid type'; + +dies_ok { + my $stuff = Stuff->new(); + $stuff->insert_options(undef); +} '... rejects unshift of an invalid type'; + +dies_ok { + my $stuff = Stuff->new(); + $stuff->set_option_at( 0, undef ); +} '... rejects set of an invalid type'; + ## test the meta my $options = $stuff->meta->get_attribute('options');