Annotation of todotxt/Text-Todo-REST-API/t/GET/tags.t, Revision 1.5
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.5 ! andrew 10: # REVISION: $AFresh1: tags.t,v 1.4 2010/01/24 04:38:21 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';
! 22: $class = 'Text::Todo::REST::API::Actions::GET';
! 23:
! 24: use_ok( $api_class, "use $api_class" );
1.1 andrew 25: use_ok( $class, "use $class" );
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' } ] );
! 31: my $action = new_ok( $class );
1.1 andrew 32:
33: my %tags = (
34: project => ['delete', 'dos', 'uno'],
35: context => ['one', 'two'],
36: );
37:
38: foreach my $tag (keys %tags) {
1.4 andrew 39: my $tags;
1.5 ! 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>