[BACK]Return to tags.t CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo-REST-API / t / GET

Annotation of todotxt/Text-Todo-REST-API/t/GET/tags.t, Revision 1.4

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.4     ! andrew     10: #     REVISION:  $AFresh1: tags.t,v 1.3 2010/01/23 07:15:40 andrew Exp $
1.1       andrew     11: #===============================================================================
                     12:
                     13: use strict;
                     14: use warnings;
                     15:
                     16: use Test::More tests => 6;
                     17:
                     18: my $class;
                     19: BEGIN {
                     20:     $class = 'Text::Todo::REST::API';
                     21:     use_ok( $class, "use $class" );
                     22: }
                     23:
                     24: diag("Testing GET tags $class $Text::Todo::REST::API::VERSION");
                     25:
1.3       andrew     26: my $api = new_ok( $class, [ { todo_dir => 't/lists' } ] );
1.1       andrew     27:
                     28: my %tags = (
                     29:     project => ['delete', 'dos', 'uno'],
                     30:     context => ['one', 'two'],
                     31: );
                     32:
                     33: foreach my $tag (keys %tags) {
1.4     ! andrew     34:     my $tags;
        !            35:     ok( $tags = $api->get_tags($api->_todo, $tag), "Get [$tag] tags" );
        !            36:     is_deeply( $tags, $tags{$tag}, 'got expected ' . $tag . 's' );
1.1       andrew     37: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>