Class/Accessor/UnitTests/Regex.pm

filter: Statementstmt 100% 40 / 40 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 0.0% 0 / 4 totaltotal 92.8% 52 / 56 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Class/UnitTests/TestEmit.pm ↑ Summary Class/Accessor/UnitTests/Glob.pm »
1 {
2 package OOP::Perlish::Class::Accessor::UnitTests::Regex;
3 1 ▶ use OOP::Perlish::Class::Accessor::UnitTests::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶ use base qw(OOP::Perlish::Class::Accessor::UnitTests::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶ use OOP::Perlish::Class::Accessor;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶ use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶ sub setup : Test(setup)
Subroutine setup: called CC=1 SCAR=0.0
Pod undocumented
9 {
10 3 my ($self) = @_;
11 3 $self->{accessor} = OOP::Perlish::Class::Accessor->new( type => 'REGEXP', name => 'test', self => bless({}, __PACKAGE__) );
12 1 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶ sub set_value : Test
Subroutine set_value: called CC=1 SCAR=0.0
Pod undocumented
15 {
16 1 my ($self) = @_;
17 1 my $regex_re = qr/foo/;
18  
19 1 $self->{accessor}->value( $regex_re );
20 1 is( $self->{accessor}->value(), $regex_re, 'can set regex_re' );
21 1 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶ sub negative_set_value : Test
Subroutine negative_set_value: called CC=1 SCAR=0.0
Pod undocumented
24 {
25 1 my ($self) = @_;
26  
27 1 my $regex_re = 'foo';
28  
29 1 $self->{accessor}->value( $regex_re );
30 1 ok( ! $self->{accessor}->value(), 'negative assert: cannot set non-regex_re' );
31 1 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 1 ▶ sub returned_regex_re_executable : Test
Subroutine returned_regex_re_executable: called CC=1 SCAR=0.0
Pod undocumented
34 {
35 1 my ($self) = @_;
36  
37 1 my $regex_re = qr/foo/;
38  
39 1 $self->{accessor}->value( $regex_re );
40 1 ok( 'foo' =~ $self->{accessor}->value(), 'can set regex_re' );
41 1 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.0
42 }
43 1 1;
44 =head1 NAME
45  
46 =head1 VERSION
47  
48 =head1 SYNOPSIS
49  
50 =head1 METHODS
51  
52 =head1 AUTHOR
53  
54 Jamie Beverly, C<< <jbeverly at cpan.org> >>
55  
56 =head1 BUGS
57  
58 Please report any bugs or feature requests to C<bug-foo-bar at rt.cpan.org>,
59 or through
60 the web interface at
61 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=OOP-Perlish-Class>. I will be
62 notified, and then you'll
63 automatically be notified of progress on your bug as I make changes.
64  
65 =head1 SUPPORT
66  
67 You can find documentation for this module with the perldoc command.
68  
69 perldoc OOP::Perlish::Class
70  
71  
72 You can also look for information at:
73  
74 =over 4
75  
76 =item * RT: CPAN's request tracker
77  
78 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=OOP-Perlish-Class>
79  
80 =item * AnnoCPAN: Annotated CPAN documentation
81  
82 L<http://annocpan.org/dist/OOP-Perlish-Class>
83  
84 =item * CPAN Ratings
85  
86 L<http://cpanratings.perl.org/d/OOP-Perlish-Class>
87  
88 =item * Search CPAN
89  
90 L<http://search.cpan.org/dist/OOP-Perlish-Class/>
91  
92 =back
93  
94  
95 =head1 ACKNOWLEDGEMENTS
96  
97 =head1 COPYRIGHT & LICENSE
98  
99 Copyright 2009 Jamie Beverly
100  
101 This program is free software; you can redistribute it and/or modify it
102 under the terms of either: the GNU General Public License as published
103 by the Free Software Foundation; or the Artistic License.
104  
105 See http://dev.perl.org/licenses/ for more information.
106  
107 =cut
« Class/UnitTests/TestEmit.pm ↑ Summary Class/Accessor/UnitTests/Glob.pm »