Skip to content

Commit

Permalink
put use_ok into BEGIN block
Browse files Browse the repository at this point in the history
  • Loading branch information
davewood committed Dec 13, 2010
1 parent 269bc95 commit e541538
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/Catalyst/Manual/Cookbook.pod
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ C<TEST_POD> environment variable is true.


mundus:~/MyApp chansen$ cat t/01app.t | perl -ne 'printf( "%2d %s", $., $_ )' mundus:~/MyApp chansen$ cat t/01app.t | perl -ne 'printf( "%2d %s", $., $_ )'
1 use Test::More tests => 2; 1 use Test::More tests => 2;
2 use_ok( Catalyst::Test, 'MyApp' ); 2 BEGIN { use_ok( Catalyst::Test, 'MyApp' ) }
3 3
4 ok( request('/')->is_success ); 4 ok( request('/')->is_success );


Expand Down Expand Up @@ -2423,7 +2423,7 @@ Be sure to check out C<Test::WWW::Mechanize::Catalyst>. It makes it easy to
test HTML, forms and links. A short example of usage: test HTML, forms and links. A short example of usage:


use Test::More tests => 6; 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; my $mech = Test::WWW::Mechanize::Catalyst->new;
$mech->get_ok("http://localhost/", 'Got index page'); $mech->get_ok("http://localhost/", 'Got index page');
Expand All @@ -2438,7 +2438,7 @@ test HTML, forms and links. A short example of usage:


=item Catalyst::Test =item Catalyst::Test


L<http://search.cpan.org/dist/Catalyst/lib/Catalyst/Test.pm> L<Catalyst::Test>


=item Test::WWW::Mechanize::Catalyst =item Test::WWW::Mechanize::Catalyst


Expand Down
2 changes: 1 addition & 1 deletion lib/Catalyst/Manual/Tutorial/08_Testing.pod
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ editor and enter the following:
# Can also do: # Can also do:
# use Test::WWW::Mechanize::Catalyst "MyApp"; # 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') # Create two 'user agents' to simulate two different users ('test01' & 'test02')
my $ua1 = Test::WWW::Mechanize::Catalyst->new; my $ua1 = Test::WWW::Mechanize::Catalyst->new;
Expand Down

0 comments on commit e541538

Please sign in to comment.