Annotation of todotxt/Text-Todo-REST-API/t/GET/files.t, Revision 1.4
1.1 andrew 1: #===============================================================================
2: #
3: # FILE: GET/files.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: files.t,v 1.3 2010/01/23 07:15:40 andrew Exp $
1.1 andrew 11: #===============================================================================
12:
13: use strict;
14: use warnings;
15:
1.4 ! andrew 16: use Test::More tests => 10;
1.1 andrew 17:
18: my $class;
19:
20: BEGIN {
21: $class = 'Text::Todo::REST::API';
22: use_ok( $class, "use $class" );
23: }
24:
25: diag("Testing GET files $class $Text::Todo::REST::API::VERSION");
26:
1.3 andrew 27: my $api = new_ok( $class, [ { todo_dir => 't/lists' } ] );
1.1 andrew 28:
1.4 ! andrew 29: my $files;
! 30: ok( $files = $api->get_files( $api->_todo ), 'Get Files' );
! 31: is_deeply( $files, ['todo.txt'], 'Got correct file' );
! 32:
! 33: my $response;
! 34: ok( $response = $api->GET('.txt'), 'Get Response Files' );
! 35:
! 36: $files = [];
! 37: ok( $files = $response->data, 'Get response data' );
! 38: is_deeply( $files, ['todo.txt'], 'Got correct file' );
! 39:
! 40: $response = undef;
! 41: ok( $response = $api->GET('/todo_file/files.txt'), 'Get Files' );
! 42:
! 43: $files = [];
! 44: ok( $files = $response->data, 'Get response data' );
! 45: is_deeply( $files, ['todo.txt'], 'Got correct file' );
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>