| 1 | { | ||||||||||
| 2 | |||||||||||
| 3 | package OOP::Perlish::Class::Accessor::UnitTests::Constructor; | ||||||||||
| 4 | 1 | ▶ | use Test::Class; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use base qw(Test::Class); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use OOP::Perlish::Class::Accessor; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use Test::More; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | sub invalid_type : Test | ||||||||
|
Subroutine
invalid_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | { | ||||||||||
| 12 | 1 | my ($self) = @_; | |||||||||
| 13 | 1 | eval { OOP::Perlish::Class::Accessor->new( type => 'ASDF', name => 'test' ); }; | |||||||||
| 14 | 1 | ok( "$@" =~ m/Invalid type specified/gsm, "We confess on invalid type" ); | |||||||||
| 15 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | sub missing_type : Test | ||||||||
|
Subroutine
missing_type: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 18 | { | ||||||||||
| 19 | 1 | my ($self) = @_; | |||||||||
| 20 | 1 | eval { OOP::Perlish::Class::Accessor->new( name => 'test' ); }; | |||||||||
| 21 | 1 | ▶ | ok( "$@" =~ m/Missing required field type/gsm, "We confess on missing required 'type' parameter" ) || diag("$@"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | |||||||||||
| 24 | 1 | ▶ | sub missing_name : Test | ||||||||
|
Subroutine
missing_name: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 25 | { | ||||||||||
| 26 | 1 | my ($self) = @_; | |||||||||
| 27 | 1 | eval { OOP::Perlish::Class::Accessor->new( type => 'SCALAR' ); }; | |||||||||
| 28 | 1 | ▶ | ok( "$@" =~ m/Missing required field name/gsim, "We confess on missing required 'name' parameter" ) || diag("$@"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | } | ||||||||||
| 31 | 1 | 1; | |||||||||
| 32 | |||||||||||
| 33 | =head1 NAME | ||||||||||
| 34 | |||||||||||
| 35 | =head1 VERSION | ||||||||||
| 36 | |||||||||||
| 37 | =head1 SYNOPSIS | ||||||||||
| 38 | |||||||||||
| 39 | =head1 METHODS | ||||||||||
| 40 | |||||||||||
| 41 | =head1 AUTHOR | ||||||||||
| 42 | |||||||||||
| 43 | Jamie Beverly, C<< <jbeverly at cpan.org> >> | ||||||||||
| 44 | |||||||||||
| 45 | =head1 BUGS | ||||||||||
| 46 | |||||||||||
| 47 | Please report any bugs or feature requests to C<bug-foo-bar at rt.cpan.org>, | ||||||||||
| 48 | or through | ||||||||||
| 49 | the web interface at | ||||||||||
| 50 | L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=OOP-Perlish-Class>. I will be | ||||||||||
| 51 | notified, and then you'll | ||||||||||
| 52 | automatically be notified of progress on your bug as I make changes. | ||||||||||
| 53 | |||||||||||
| 54 | =head1 SUPPORT | ||||||||||
| 55 | |||||||||||
| 56 | You can find documentation for this module with the perldoc command. | ||||||||||
| 57 | |||||||||||
| 58 | perldoc OOP::Perlish::Class | ||||||||||
| 59 | |||||||||||
| 60 | |||||||||||
| 61 | You can also look for information at: | ||||||||||
| 62 | |||||||||||
| 63 | =over 4 | ||||||||||
| 64 | |||||||||||
| 65 | =item * RT: CPAN's request tracker | ||||||||||
| 66 | |||||||||||
| 67 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=OOP-Perlish-Class> | ||||||||||
| 68 | |||||||||||
| 69 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||
| 70 | |||||||||||
| 71 | L<http://annocpan.org/dist/OOP-Perlish-Class> | ||||||||||
| 72 | |||||||||||
| 73 | =item * CPAN Ratings | ||||||||||
| 74 | |||||||||||
| 75 | L<http://cpanratings.perl.org/d/OOP-Perlish-Class> | ||||||||||
| 76 | |||||||||||
| 77 | =item * Search CPAN | ||||||||||
| 78 | |||||||||||
| 79 | L<http://search.cpan.org/dist/OOP-Perlish-Class/> | ||||||||||
| 80 | |||||||||||
| 81 | =back | ||||||||||
| 82 | |||||||||||
| 83 | |||||||||||
| 84 | =head1 ACKNOWLEDGEMENTS | ||||||||||
| 85 | |||||||||||
| 86 | =head1 COPYRIGHT & LICENSE | ||||||||||
| 87 | |||||||||||
| 88 | Copyright 2009 Jamie Beverly | ||||||||||
| 89 | |||||||||||
| 90 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 91 | under the terms of either: the GNU General Public License as published | ||||||||||
| 92 | by the Free Software Foundation; or the Artistic License. | ||||||||||
| 93 | |||||||||||
| 94 | See http://dev.perl.org/licenses/ for more information. | ||||||||||
| 95 | |||||||||||
| 96 | =cut | ||||||||||