Annotation of todotxt/Text-Todo-REST-API/t/GET/tags.t, Revision 1.6
1.1 andrew 1: #===============================================================================
2: #
3: # FILE: GET/tags.t
4: #
5: # DESCRIPTION: Test Text::Todo::REST::API
6: #
7: # AUTHOR: Andrew Fresh (AAF), andrew@cpan.org
8: # COMPANY: Red River Communications
9: # CREATED: 01/07/10 19:11
1.6 ! andrew 10: # REVISION: $AFresh1: tags.t,v 1.5 2010/01/26 04:30:13 andrew Exp $
1.1 andrew 11: #===============================================================================
12:
13: use strict;
14: use warnings;
15:
1.5 andrew 16: use Test::More tests => 8;
17: my $api_class;
18: my $class;
1.1 andrew 19:
20: BEGIN {
1.5 andrew 21: $api_class = 'Text::Todo::REST::API';
1.6 ! andrew 22: $class = 'Text::Todo::REST::API::Actions::GET';
1.5 andrew 23:
24: use_ok( $api_class, "use $api_class" );
1.6 ! andrew 25: use_ok( $class, "use $class" );
1.1 andrew 26: }
27:
1.5 andrew 28: diag("Testing GET tags $class $Text::Todo::REST::API::Actions::GET::VERSION");
1.1 andrew 29:
1.5 andrew 30: my $api = new_ok( $api_class, [ { todo_dir => 't/lists' } ] );
1.6 ! andrew 31: my $action = new_ok($class);
1.1 andrew 32:
33: my %tags = (
1.6 ! andrew 34: project => [ 'delete', 'dos', 'uno' ],
! 35: context => [ 'one', 'two' ],
1.1 andrew 36: );
37:
1.6 ! andrew 38: foreach my $tag ( keys %tags ) {
1.4 andrew 39: my $tags;
1.6 ! andrew 40: ok( $tags = $action->get_tags( $api->_todo, $tag ), "Get [$tag] tags" );
1.4 andrew 41: is_deeply( $tags, $tags{$tag}, 'got expected ' . $tag . 's' );
1.1 andrew 42: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>