Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests and fix True/False => 1/0 bug
- Loading branch information
Showing
6 changed files
with
53 additions
and
2 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
Revision history for WWW::ItsABot | |||
|
|||
|
|||
* 0.01 - is_a_bot() function |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,13 @@ | |||
Build.PL | Build.PL | ||
Changes | Changes | ||
lib/WWW/ItsABot.pm | |||
MANIFEST | MANIFEST | ||
MANIFEST.SKIP | |||
README | README | ||
lib/WWW/ItsABot.pm | |||
t/00-load.t | t/00-load.t | ||
t/01-basic.t | |||
t/boilerplate.t | |||
t/pod-coverage.t | t/pod-coverage.t | ||
t/pod.t | t/pod.t | ||
Makefile.PL | |||
META.yml |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
.*\.swp | |||
\.git* | |||
tmp.* | |||
.*\.o | |||
\.bak | |||
_build | |||
^Build$ | |||
blib/* | |||
.*\.data | |||
.*core | |||
foo* | |||
.*\.gz | |||
^tags | |||
Math-Primality | |||
\.prove |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
#!/usr/bin/env perl -w | |||
|
|||
use strict; | |||
use warnings; | |||
use lib qw(t/lib); | |||
use Test::More tests => 2; | |||
|
|||
use WWW::ItsABot qw/is_a_bot/; | |||
do { | |||
no warnings 'redefine'; | |||
*WWW::ItsABot::get = sub($) { | |||
my $url = shift; | |||
if ( $url =~ m!/User/bot! ){ | |||
return "bot,6635,0,753,True,8.81142098274,0.0,2009-06-15 04:35:31.410268\n"; | |||
} else { | |||
return "user,187,150,662,False,0.509063444109,0.802139037433,2009-06-15 06:03:57.740732\n"; | |||
} | |||
}; | |||
}; | |||
|
|||
cmp_ok( is_a_bot('bot'),'==', 1, 'bots are bots' ); | |||
|
|||
cmp_ok( is_a_bot('dukeleto'),'==', 0, 'should not be a bot' ); |