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

Diff for /todotxt/Text-Todo/t/dudelicious.t between version 1.3 and 1.5

version 1.3, 2010/04/29 05:50:33 version 1.5, 2010/04/30 02:42:20
Line 29 
Line 29 
   
 my $t = Test::Mojo->new;  my $t = Test::Mojo->new;
   
 # Index page  my @exts = ( q{}, '.html', '.txt', '.json' );
 $t->get_ok('/')->status_is(200)->content_like(qr/todo1\.txt/xms);  
   
 $t->get_ok('/l/todo1')->status_is(200)->content_is(  foreach my $p (
     q{<!doctype html><html>      '/',
     <head><title>Funky!</title></head>      ( map { '/l/todo1' . $_ } @exts ),
     <body><h1>todo1</h1>      ( map { '/l/todo1/e/1' . $_ } @exts ),
 <ol>      ( map { '/l/todo1/e/4' . $_ } @exts ),
     <li>      ( map { '/l/todo1/t' . $_ } @exts ),
 (B) +GarageSale @phone schedule Goodwill pickup      ( map { '/l/todo1/t/project' . $_ } @exts ),
     </li>      ( map { '/l/todo1/t/context' . $_ } @exts ),
     <li>      )
 +GarageSale @home post signs around the neighborhood DUE:2006-08-01  {
     </li>      my ( $volume, $directories, $file ) = File::Spec->splitpath($p);
     <li>  
 X eat meatballs @home  
     </li>  
     <li>  
 (A) @phone thank Mom for the meatballs WAIT  
     </li>  
     <li>  
   
     </li>      $file ||= 'index.html';
     <li>      $file .= '.html' if $file !~ /\.[^.]+$/xms;
 @shopping Eskimo pies  
     </li>  
     <li>  
 email andrew@cpan.org for help +report_bug @wherever  
     </li>  
     <li>  
 x 2009-01-01 completed with a date  
     </li>  
 </ol>  
 </body>  
 </html>  
 }  
 );  
   
 $t->get_ok('/l/todo1.txt')->status_is(200)->content_is(      my $f = File::Spec->catfile( 't', 'dudelicious', $volume, $directories,
     q{(B) +GarageSale @phone schedule Goodwill pickup          $file );
 +GarageSale @home post signs around the neighborhood DUE:2006-08-01  
 X eat meatballs @home  
 (A) @phone thank Mom for the meatballs WAIT  
   
 @shopping Eskimo pies  SKIP: {
 email andrew@cpan.org for help +report_bug @wherever          skip "$f does not exist", 3 if !-e $f;
 x 2009-01-01 completed with a date  
 }  
 );  
   
 $t->get_ok('/l/todo1/e/1')->status_is(200)->content_is(          diag("Getting [$f] from [$p]");
     q{<!doctype html><html>          open my $fh, '<', $f or die $f . ': ' . $!;
     <head><title>Funky!</title></head>          $t->get_ok($p)->status_is(200)->content_is(
     <body>(B) +GarageSale @phone schedule Goodwill pickup              do { local $/; <$fh> }
 </body>          );
 </html>          close $fh;
       }
 }  }
 );  
   
 $t->get_ok('/l/todo1/e/1.txt')->status_is(200)->content_is(  
     q{(B) +GarageSale @phone schedule Goodwill pickup  
 }  
 );  
   
 done_testing();  done_testing();

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

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