| version 1.11, 2010/01/11 19:52:06 |
version 1.14, 2010/02/13 23:06:34 |
|
|
| # AUTHOR: Andrew Fresh (AAF), andrew@cpan.org |
# AUTHOR: Andrew Fresh (AAF), andrew@cpan.org |
| # COMPANY: Red River Communications |
# COMPANY: Red River Communications |
| # CREATED: 07/10/09 11:32:39 |
# CREATED: 07/10/09 11:32:39 |
| # REVISION: $AFresh1: entry.t,v 1.10 2010/01/11 01:30:24 andrew Exp $ |
# REVISION: $AFresh1: entry.t,v 1.13 2010/01/15 19:50:15 andrew Exp $ |
| #=============================================================================== |
#=============================================================================== |
| |
|
| use strict; |
use strict; |
| use warnings; |
use warnings; |
| |
|
| use Test::More tests => 40; |
use Test::More tests => 41; |
| |
|
| my $class = 'Text::Todo::Entry'; |
my $class; |
| |
BEGIN { |
| |
$class = 'Text::Todo::Entry'; |
| |
use_ok( $class, "use $class" ) |
| |
} |
| |
|
| BEGIN: { use_ok( $class, "use $class" ) } |
|
| |
|
| diag("Testing entry $class $Text::Todo::Entry::VERSION"); |
diag("Testing entry $class $Text::Todo::Entry::VERSION"); |
| |
|
| my %sample = ( |
my %sample = ( |
| text => '(B) @home @work send email to andrew@cpan.org + +say_thanks', |
text => '(B) @home @work send email to andrew@cpan.org + +say_thanks', |
| priority => 'B', |
priority => 'B', |
| |
known_tags => { context => '@', project => '+' }, |
| contexts => [ 'home', 'work' ], |
contexts => [ 'home', 'work' ], |
| projects => [ '', 'say_thanks' ], |
projects => [ '', 'say_thanks' ], |
| prepend => 'before', |
prepend => 'before', |
|
|
| ); |
); |
| |
|
| my $e = new_ok($class); |
my $e = new_ok($class); |
| |
is_deeply( $e->known_tags, $sample{known_tags}, 'check known_tags' ); |
| |
|
| ok( $e->replace( $sample{text} ), 'Update entry' ); |
ok( $e->replace( $sample{text} ), 'Update entry' ); |
| is( $e->text, $sample{text}, 'Make sure entry matches' ); |
is( $e->text, $sample{text}, 'Make sure entry matches' ); |