version 1.13, 2010/01/15 19:50:15 |
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.12 2010/01/15 19:44:32 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; |
my $class; |
BEGIN { |
BEGIN { |
|
|
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' ); |