Skip to content
Browse files

added a test for the title_is and title_like

  • Loading branch information...
1 parent 8036365 commit 7103476f4a6ba668183c3d2a365ad82cc253fd98 @petdance committed Apr 13, 2012
Showing with 29 additions and 0 deletions.
  1. +1 −0 MANIFEST
  2. +28 −0 t/title_is.t
View
1 MANIFEST
@@ -43,3 +43,4 @@ t/submit_form_ok.t
t/table.html
t/TestServer.pm
t/text_contains.t
+t/title_is.t
View
28 t/title_is.t
@@ -0,0 +1,28 @@
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More tests => 4;
+use Test::Builder::Tester;
+use URI::file;
+
+use Test::WWW::Mechanize ();
+
+my $mech=Test::WWW::Mechanize->new( autocheck => 0 );
+isa_ok($mech,'Test::WWW::Mechanize');
+
+# Good links.
+my $uri = URI::file->new_abs( 't/good.html' )->as_string;
+$mech->get_ok( $uri );
+
+test_out( 'ok 1 - Is this the test page?' );
+test_out( 'ok 2 - Title is "Test Page"' );
+$mech->title_is( 'Test Page', 'Is this the test page?' );
+$mech->title_is( 'Test Page' );
+test_test( 'Finds the title OK' );
+
+test_out( 'ok 1 - Is this like the test page?' );
+$mech->title_like( qr/[tf]est (p)age/i, 'Is this like the test page?' );
+test_test( 'Finds the title OK' );
+
+done_testing();

0 comments on commit 7103476

Please sign in to comment.
Something went wrong with that request. Please try again.