Permalink
Browse files

fixed a TODO test

  • Loading branch information...
petdance committed Apr 13, 2012
1 parent ba3d6a9 commit 589c02d5848ebfdf29c3b4d56a0084134ce56d0a
Showing with 11 additions and 5 deletions.
  1. +11 −5 t/follow_link_ok.t
View
@@ -5,7 +5,7 @@ use warnings;
use Test::More tests => 6;
use Test::Builder::Tester;
-use URI::file;
+use URI::file ();
use Test::WWW::Mechanize ();
@@ -15,21 +15,27 @@ FOLLOW_GOOD_LINK: {
my $uri = URI::file->new_abs( 't/goodlinks.html' )->as_string;
$mech->get_ok( $uri );
+ test_out( 'ok 1 - Go after first link' );
$mech->follow_link_ok( {n=>1}, 'Go after first link' );
+ test_test( 'Handles good links' );
}
FOLLOW_BAD_LINK: {
- local $TODO = q{I don't know how to get Test::Builder::Tester to handle regexes for the timestamp.};
-
my $mech = Test::WWW::Mechanize->new( autocheck => 0 );
isa_ok( $mech, 'Test::WWW::Mechanize' );
my $uri = URI::file->new_abs( 't/badlinks.html' )->as_string;
+
+ my $path = $uri;
+ $path =~ s{file://}{};
+ $path =~ s{\Qbadlinks.html}{bad1.html};
+
$mech->get_ok( $uri );
test_out('not ok 1 - Go after bad link');
- test_fail(+1);
+ test_fail(+3);
+ test_diag( 404 ); # XXX Who is printing this 404, and should it be?
+ test_diag( qq{File `$path' does not exist} );
$mech->follow_link_ok( {n=>2}, 'Go after bad link' );
- test_diag('');
test_test('Handles bad links');
}

0 comments on commit 589c02d

Please sign in to comment.