-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef6a693
commit a7807b5
Showing
6 changed files
with
55 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 7; | ||
|
||
use Test::More; | ||
|
||
use_ok 'Data::Dump'; | ||
use_ok 'File::Slurp'; | ||
use_ok 'FindBin'; | ||
use_ok 'Getopt::Long'; | ||
use_ok 'Getopt::Long'; | ||
use_ok 'JSON'; | ||
use_ok 'LWP'; | ||
use_ok 'MIME::Types'; | ||
use_ok 'Pod::Usage'; | ||
|
||
done_testing(8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use FindBin; | ||
use FindBin; | ||
use Test::More; | ||
|
||
use lib "$FindBin::Bin/../lib/"; | ||
|
@@ -26,11 +26,13 @@ my $INVALID_API_KEY = '1234567890'; | |
# checks new() function | ||
# | ||
my $pb = WWW::PushBullet->new(); | ||
ok(! defined $pb, "WWW::PushBullet->new() => undef"); | ||
ok(!defined $pb, "WWW::PushBullet->new() => undef"); | ||
|
||
my $pb2 = WWW::PushBullet->new({apikey => $INVALID_API_KEY}); | ||
ok((defined $pb2) && (ref $pb2 eq 'WWW::PushBullet'), | ||
"WWW::PushBullet->new({apikey => '$INVALID_API_KEY'}) => WWW::PushBullet object"); | ||
ok( | ||
(defined $pb2) && (ref $pb2 eq 'WWW::PushBullet'), | ||
"WWW::PushBullet->new({apikey => '$INVALID_API_KEY'}) => WWW::PushBullet object" | ||
); | ||
|
||
# | ||
# checks api_key() function | ||
|
@@ -39,15 +41,18 @@ my $api_key = $pb2->api_key(); | |
ok($api_key eq $INVALID_API_KEY, 'WWW::PushBullet->api_key() => api_key'); | ||
|
||
my $debug_mode = $pb2->debug_mode(1); | ||
my $debug_str = $pb2->DEBUG('test'); | ||
my $debug_str = $pb2->DEBUG('test'); | ||
ok($debug_mode && ($debug_str eq '[DEBUG] test'), 'debug_mode on'); | ||
|
||
$debug_mode = $pb2->debug_mode(0); | ||
$debug_str = $pb2->DEBUG('test'); | ||
$debug_str = $pb2->DEBUG('test'); | ||
ok(!$debug_mode && !defined $debug_str, 'debug_mode off'); | ||
|
||
my $version = $pb2->version(); | ||
ok(defined $version && $version =~ /^\d+.*/, 'WWW::PushBullet->version() => version'); | ||
ok( | ||
defined $version && $version =~ /^\d+.*/, | ||
'WWW::PushBullet->version() => version' | ||
); | ||
|
||
foreach my $func (@pb_functions) | ||
{ | ||
|
@@ -60,4 +65,4 @@ done_testing(4 + 2 + 1 + scalar @pb_functions); | |
Sebastien Thebert <[email protected]> | ||
=cut | ||
=cut |