Annotation of todotxt/Text-Todo-REST-API/t/GET/list.t, Revision 1.1
1.1 ! andrew 1: #===============================================================================
! 2: #
! 3: # FILE: GET/list.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
! 10: # REVISION: $AFresh1$
! 11: #===============================================================================
! 12:
! 13: use strict;
! 14: use warnings;
! 15:
! 16: use Test::More tests => 5;
! 17:
! 18: my $class;
! 19: BEGIN {
! 20: $class = 'Text::Todo::REST::API';
! 21: use_ok( $class, "use $class" );
! 22: }
! 23:
! 24: diag("Testing GET list $class $Text::Todo::REST::API::VERSION");
! 25:
! 26: my $api = new_ok( $class, [ { basedir => 't', path_info => '/lists/todo' } ] );
! 27:
! 28: my $list_should_be = [
! 29: { 'text' => '(A) entry 1 @one +uno',
! 30: 'md5' => '931e0831c31a70928b29de55778dc294',
! 31: 'line' => 1
! 32: },
! 33: { 'text' => 'entry 2 @two +dos',
! 34: 'md5' => 'b38dde8029c047e81379d9de581a6251',
! 35: 'line' => 2
! 36: },
! 37: { 'text' => '',
! 38: 'md5' => 'd41d8cd98f00b204e9800998ecf8427e',
! 39: 'line' => 3
! 40: },
! 41: { 'text' => 'x completed entry 4',
! 42: 'md5' => '8de0a2b65a50d5e30e84ad48af46fa78',
! 43: 'line' => 4
! 44: },
! 45: { 'text' => '(B) entry 5 is priority',
! 46: 'md5' => 'c1692dfbf3b5829b6bce44b1a1614980',
! 47: 'line' => 5
! 48: },
! 49: { 'text' => 'entry 6 +delete',
! 50: 'md5' => 'e1f6bf867f75aa019063782554407d02',
! 51: 'line' => 6
! 52: }
! 53: ];
! 54:
! 55: my @list;
! 56: ok( @list = $api->get_list, 'Get List' );
! 57: is( scalar @list, 6, 'list is right length' );
! 58: is_deeply( \@list, $list_should_be, 'check that we got the right list' );
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>