From: Shawn M Moore Date: Sun, 18 Jan 2009 02:05:45 +0000 (+0000) Subject: Make sure this length parameter is r/o X-Git-Tag: 0.05~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c627ed855540a7478837f1e7029e9496403b0f99;p=gitmo%2FMooseX-Role-Parameterized.git Make sure this length parameter is r/o --- diff --git a/t/001-parameters.t b/t/001-parameters.t index 838cca0..e94516f 100644 --- a/t/001-parameters.t +++ b/t/001-parameters.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 13; use Test::Exception; use MooseX::Role::Parameterized::Parameters; @@ -45,6 +45,10 @@ $p = MyRole::LengthParameter->meta->construct_parameters( is($p->length, 5, "correct length"); +throws_ok { + $p->length(10); +} qr/^Cannot assign a value to a read-only accessor/; + do { package MyRole::LengthParameter; use MooseX::Role::Parameterized;