Faker/Plugin/InternetEmailAddress.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod n/a totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Faker::Plugin::InternetEmailAddress;
2  
3 use 5.014;
4  
5 use strict;
6 use warnings;
7  
8 use registry;
9 use routines;
10  
11 use Data::Object::Class;
12 use Data::Object::ClassHas;
13  
14 extends 'Data::Object::Plugin';
15  
16 our $VERSION = '1.03'; # VERSION
17  
18 # ATTRIBUTES
19  
20 has 'faker' => (
21 is => 'ro',
22 isa => 'ConsumerOf["Faker::Maker"]',
23 req => 1,
24 );
25  
26 # METHODS
27  
28 method execute() {
29 my $faker = $self->faker;
30  
31 my $email_address = $faker->process(['internet', 'email']);
32  
33 $email_address =~ s/[^\w\.\@]+/-/g;
34 $email_address =~ s/[^\w\.\@]+$//;
35  
36 return lc $email_address;
37 }
38  
39 1;
40  
41 =encoding utf8
42  
43 =head1 NAME
44  
45 Faker::Plugin::InternetEmailAddress
46  
47 =cut
48  
49 =head1 ABSTRACT
50  
51 Internet Email Address Plugin for Faker
52  
53 =cut
54  
55 =head1 SYNOPSIS
56  
57 package main;
58  
59 use Faker;
60 use Faker::Plugin::InternetEmailAddress;
61  
62 my $f = Faker->new;
63 my $p = Faker::Plugin::InternetEmailAddress->new(faker => $f);
64  
65 my $plugin = $p;
66  
67 =cut
68  
69 =head1 DESCRIPTION
70  
71 This package provides methods for generating fake internet email address data.
72  
73 =cut
74  
75 =head1 INHERITS
76  
77 This package inherits behaviors from:
78  
79 L<Data::Object::Plugin>
80  
81 =cut
82  
83 =head1 LIBRARIES
84  
85 This package uses type constraints from:
86  
87 L<Types::Standard>
88  
89 =cut
90  
91 =head1 ATTRIBUTES
92  
93 This package has the following attributes:
94  
95 =cut
96  
97 =head2 faker
98  
99 faker(ConsumerOf["Faker::Maker"])
100  
101 This attribute is read-only, accepts C<(ConsumerOf["Faker::Maker"])> values, and is required.
102  
103 =cut
104  
105 =head1 METHODS
106  
107 This package implements the following methods:
108  
109 =cut
110  
111 =head2 execute
112  
113 execute() : Str
114  
115 The execute method returns a random fake internet email address.
116  
117 =over 4
118  
119 =item execute example #1
120  
121 # given: synopsis
122  
123 $p->execute;
124  
125 =back
126  
127 =cut
128  
129 =head1 AUTHOR
130  
131 Al Newkirk, C<awncorp@cpan.org>
132  
133 =head1 LICENSE
134  
135 Copyright (C) 2011-2019, Al Newkirk, et al.
136  
137 This is free software; you can redistribute it and/or modify it under the terms
138 of the The Apache License, Version 2.0, as elucidated in the L<"license
139 file"|https://github.com/iamalnewkirk/faker/blob/master/LICENSE>.
140  
141 =head1 ACKNOWLEDGEMENTS
142  
143 Parts of this library were inspired by the following implementations:
144  
145 L<PHP Faker|https://github.com/fzaninotto/Faker>
146  
147 L<Ruby Faker|https://github.com/stympy/faker>
148  
149 L<Python Faker|https://github.com/joke2k/faker>
150  
151 L<JS Faker|https://github.com/Marak/faker.js>
152  
153 L<Elixir Faker|https://github.com/elixirs/faker>
154  
155 =head1 PROJECT
156  
157 L<Wiki|https://github.com/iamalnewkirk/faker/wiki>
158  
159 L<Project|https://github.com/iamalnewkirk/faker>
160  
161 L<Initiatives|https://github.com/iamalnewkirk/faker/projects>
162  
163 L<Milestones|https://github.com/iamalnewkirk/faker/milestones>
164  
165 L<Contributing|https://github.com/iamalnewkirk/faker/blob/master/CONTRIBUTE.md>
166  
167 L<Issues|https://github.com/iamalnewkirk/faker/issues>
168  
169 =cut