From: Rafael Kitover Date: Wed, 11 Aug 2010 04:10:04 +0000 (+0000) Subject: re-add pod_spelling.t since it is in MANIFEST.SKIP X-Git-Tag: v0.09004~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43db6fd3d45e0581bf101b2df010eb71e735558c;p=p5sagit%2FClass-Accessor-Grouped.git re-add pod_spelling.t since it is in MANIFEST.SKIP --- diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 559458d..54410e4 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -188,14 +188,17 @@ sub make_group_accessor { my $get = "get_$group"; # eval for faster fastiness - return eval "sub { + my $code = eval "sub { if(\@_ > 1) { return shift->$set('$field', \@_); } else { return shift->$get('$field'); } - };" + };"; + Carp::croak $@ if $@; + + return $code; } =head2 make_group_ro_accessor @@ -218,7 +221,7 @@ sub make_group_ro_accessor { my $get = "get_$group"; - return eval "sub { + my $code = eval "sub { if(\@_ > 1) { my \$caller = caller; Carp::croak(\"'\$caller' cannot alter the value of '$field' on \". @@ -227,7 +230,10 @@ sub make_group_ro_accessor { else { return shift->$get('$field'); } - };" + };"; + Carp::croak $@ if $@; + + return $code; } =head2 make_group_wo_accessor @@ -250,7 +256,7 @@ sub make_group_wo_accessor { my $set = "set_$group"; - return eval "sub { + my $code = eval "sub { unless (\@_ > 1) { my \$caller = caller; Carp::croak(\"'\$caller' cannot access the value of '$field' on \". @@ -259,7 +265,10 @@ sub make_group_wo_accessor { else { return shift->$set('$field', \@_); } - };" + };"; + Carp::croak $@ if $@; + + return $code; } =head2 get_simple diff --git a/t/pod_spelling.t b/t/pod_spelling.t new file mode 100644 index 0000000..079ae51 --- /dev/null +++ b/t/pod_spelling.t @@ -0,0 +1,37 @@ +#!perl -w +# $Id: pod_spelling.t 7003 2009-07-08 02:24:06Z claco $ +use strict; +use warnings; + +BEGIN { + use lib 't/lib'; + use Test::More; + + plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR}; + + eval 'use Test::Spelling 0.11'; + plan skip_all => 'Test::Spelling 0.11 not installed' if $@; +}; + +set_spell_cmd('aspell list'); + +add_stopwords(); + +all_pod_files_spelling_ok(); + +__DATA__ +Bowden +Raygun +Roditi +isa +mst +behaviour +further +overridable +Laco +Pauley +claco +stylings +fieldspec +listref +getters