From: David Schmidt Date: Mon, 13 Dec 2010 15:08:02 +0000 (+0000) Subject: put use_ok into BEGIN block X-Git-Tag: v5.8006~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=commitdiff_plain;h=e541538422e839971d0c91c47ea19029de01cfa5 put use_ok into BEGIN block --- diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index 9521beb..bb56535 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -2358,7 +2358,7 @@ C environment variable is true. mundus:~/MyApp chansen$ cat t/01app.t | perl -ne 'printf( "%2d %s", $., $_ )' 1 use Test::More tests => 2; - 2 use_ok( Catalyst::Test, 'MyApp' ); + 2 BEGIN { use_ok( Catalyst::Test, 'MyApp' ) } 3 4 ok( request('/')->is_success ); @@ -2423,7 +2423,7 @@ Be sure to check out C. It makes it easy to test HTML, forms and links. A short example of usage: use Test::More tests => 6; - use_ok( Test::WWW::Mechanize::Catalyst, 'MyApp' ); + BEGIN { use_ok( Test::WWW::Mechanize::Catalyst, 'MyApp' ) } my $mech = Test::WWW::Mechanize::Catalyst->new; $mech->get_ok("http://localhost/", 'Got index page'); @@ -2438,7 +2438,7 @@ test HTML, forms and links. A short example of usage: =item Catalyst::Test -L +L =item Test::WWW::Mechanize::Catalyst diff --git a/lib/Catalyst/Manual/Tutorial/08_Testing.pod b/lib/Catalyst/Manual/Tutorial/08_Testing.pod index c015af6..b247014 100644 --- a/lib/Catalyst/Manual/Tutorial/08_Testing.pod +++ b/lib/Catalyst/Manual/Tutorial/08_Testing.pod @@ -188,7 +188,7 @@ editor and enter the following: # Can also do: # use Test::WWW::Mechanize::Catalyst "MyApp"; - use ok "Test::WWW::Mechanize::Catalyst" => "MyApp"; + BEGIN { use_ok("Test::WWW::Mechanize::Catalyst" => "MyApp") } # Create two 'user agents' to simulate two different users ('test01' & 'test02') my $ua1 = Test::WWW::Mechanize::Catalyst->new;