File: [local] / todotxt / Text-Todo / t / special_tags.t (download)
Revision 1.5, Fri Jan 15 19:50:15 2010 UTC (14 years, 5 months ago) by andrew
Branch: MAIN
CVS Tags: Text-Todo-0_1_1, Text-Todo-0_1_0 Changes since 1.4: +6 -4 lines
Now that it is actually a BEGIN block, intialize $class inside the bock.
|
#===============================================================================
#
# FILE: special_tags.t
#
# DESCRIPTION: Test special tags
#
# AUTHOR: Andrew Fresh (AAF), andrew@cpan.org
# COMPANY: Red River Communications
# CREATED: 01/09//10 17:43
# REVISION: $AFresh1: special_tags.t,v 1.5 2010/01/15 19:50:15 andrew Exp $
#===============================================================================
use strict;
use warnings;
use Test::More tests => 7;
my $class;
BEGIN {
$class = 'Text::Todo::Entry';
use_ok( $class, "use $class" )
}
diag("Testing special tags in $class $Text::Todo::Entry::VERSION");
my %sample = (
text => '(B) @home @work send email to andrew@cpan.org DUE:2011-01-01 +say_thanks',
priority => 'B',
contexts => [ 'home', 'work' ],
projects => ['say_thanks'],
due_dates => ['2011-01-01'],
);
my $e = new_ok($class, [ {text => $sample{text}, tags => { due_date => 'DUE:' }} ]);
is( $e->text, $sample{text}, 'Make sure entry matches' );
is( $e->priority, $sample{priority}, 'check priority' );
is_deeply( [ $e->contexts ], $sample{contexts}, 'check contexts' );
is_deeply( [ $e->projects ], $sample{projects}, 'check projects' );
is_deeply( [ $e->due_dates ], $sample{due_dates}, 'check due_dates');
#done_testing();