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

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

1.1       andrew      1: #===============================================================================
                      2: #
                      3: #         FILE:  GET.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: GET.t,v 1.5 2010/01/23 07:15:40 andrew Exp $
1.1       andrew     11: #===============================================================================
                     12:
                     13: use strict;
                     14: use warnings;
                     15:
1.6     ! andrew     16: use Test::More tests => 6;
1.1       andrew     17:
                     18: my $class;
1.3       andrew     19:
1.1       andrew     20: BEGIN {
                     21:     $class = 'Text::Todo::REST::API';
                     22:     use_ok( $class, "use $class" );
                     23: }
                     24:
                     25: diag("Testing GET $class $Text::Todo::REST::API::VERSION");
                     26:
1.5       andrew     27: my $api = new_ok( $class, [ { todo_dir => 't/lists' } ] );
1.1       andrew     28:
1.6     ! andrew     29: my $result;
        !            30: ok( eval { $result = $api->GET('/files.txt') }, 'GET method' );
        !            31: is( (ref $result), 'Text::Todo::REST::API::Response', 'Got expected result' );
        !            32: is_deeply( $result->data, ['todo.txt'], 'Got proper data' );
        !            33: is( $result->render, "todo.txt\n", "Rendered properly" );

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