Skip to content

Commit 60d1582

Browse files
committed
added driver for SMS::Send
1 parent f6b365c commit 60d1582

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

Changes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Revision history for SMS-API-CMTelecom
22

3-
0.01 Date/time
3+
0.02 2017-04-29
4+
Added a driver for SMS::Send.
5+
6+
0.01 2017-04-29
47
First version, released on an unsuspecting world.
58

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ RUN cpanm LWP::UserAgent
44
RUN cpanm LWP::Protocol::https
55
RUN cpanm JSON
66
RUN cpanm Test::CheckManifest Test::Pod::Coverage Test::Pod
7+
RUN cpanm SMS::Send
78

89
WORKDIR /app

Makefile.PL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ WriteMakefile(
1919
'Test::CheckManifest' => 0,
2020
'Test::Pod::Coverage' => 0,
2121
'Test::Pod' => 0,
22+
'SMS::Send' => 0,
2223
},
2324
PREREQ_PM => {
2425
'LWP::UserAgent' => 0,

lib/SMS/API/CMTelecom.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Version 0.01
1616
1717
=cut
1818

19-
our $VERSION = '0.01';
19+
our $VERSION = '0.02';
2020

2121

2222
=head1 SYNOPSIS

t/03-sms-real.t

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ subtest simple_message => sub {
4040
is_deeply $res, {
4141
messages => [
4242
{
43-
to => $phone_number,
43+
to => clean_number($phone_number),
4444
parts => 1,
4545
reference => undef,
4646
messageDetails => undef,
@@ -72,7 +72,7 @@ subtest simple_message_with_reference => sub {
7272
is_deeply $res, {
7373
messages => [
7474
{
75-
to => $phone_number,
75+
to => clean_number($phone_number),
7676
parts => 1,
7777
reference => $reference,
7878
messageDetails => undef,
@@ -83,3 +83,8 @@ subtest simple_message_with_reference => sub {
8383
is $sms->error_message, undef, 'error message is empty';
8484
};
8585

86+
sub clean_number {
87+
my $num = shift;
88+
$num =~ s/\D//g;
89+
return $num;
90+
}

0 commit comments

Comments
 (0)