Commits

Anonymous committed 6a41229

Change _tester to tester

Comments (0)

Files changed (7)

Test-WWW-Mechanize-Mojo/lib/Test/WWW/Mechanize/Mojo.pm

 }
 
 
-sub _tester
+sub tester
 {
     my $self = shift;
 
     if (@_)
     {
-        $self->{_tester} = shift;
+        $self->{tester} = shift;
     }
 
-    return $self->{_tester};
+    return $self->{tester};
 }
 
 sub new {
 
   my $self = $class->SUPER::new(%$args);
 
+  if ($args->{tester})
+  {
+      $self->tester($args->{tester});
+  }
+  else
+  {
+      $self->tester(Test::Mojo->new());
+  }
+
   $self->{allow_external} = 0;
 
-  if (!$self->_tester())
-  {
-      $self->_tester(Test::Mojo->new());
-  }
-
   return $self;
 }
 
     my @creds = $self->get_basic_credentials( "Basic", $uri );
     $request->authorization_basic( @creds ) if @creds;
 
-    my $t = $self->_tester;
+    my $t = $self->tester;
   
     # Client
     my $client = $t->client;

Test-WWW-Mechanize-Mojo/t/auth-test.t

 
 my $root = "http://localhost";
 
-my $m = Test::WWW::Mechanize::Mojo->new(_tester => $t);
+my $m = Test::WWW::Mechanize::Mojo->new(tester => $t);
 $m->credentials( 'user', 'pass' );
 
 $m->get_ok("$root/check_auth_basic/");

Test-WWW-Mechanize-Mojo/t/cookies.t

 
 my $root = "http://localhost";
 
-my $m = Test::WWW::Mechanize::Mojo->new(_tester => $t);
+my $m = Test::WWW::Mechanize::Mojo->new(tester => $t);
 
 $m->credentials( 'user', 'pass' );
 

Test-WWW-Mechanize-Mojo/t/redirect.t

 
 # TEST:$n=3;
 foreach my $where (qw{hi greetings bonjour}) {
-    $m = Test::WWW::Mechanize::Mojo->new(_tester => $t);
+    $m = Test::WWW::Mechanize::Mojo->new(tester => $t);
     # TEST*$n
     $m->get_ok( "$root/$where", "got something when we $where" );
 

Test-WWW-Mechanize-Mojo/t/simple.t

 my $root = "http://localhost";
 
 my $t = Test::Mojo->new();
-my $m = Test::WWW::Mechanize::Mojo->new( autocheck => 0, _tester => $t,);
+my $m = Test::WWW::Mechanize::Mojo->new( autocheck => 0, tester => $t,);
 
 # TEST
 $m->get_ok("$root/");

Test-WWW-Mechanize-Mojo/t/useragent.t

 my $root = "http://localhost";
 my $agent = 'TestAgent/1.0';
 my $t = Test::Mojo->new();
-my $m = Test::WWW::Mechanize::Mojo->new(agent => $agent, _tester => $t,);
+my $m = Test::WWW::Mechanize::Mojo->new(agent => $agent, tester => $t,);
 
 $m->get_ok("$root/user_agent");
 $m->title_is($agent, "title is correct: $agent");

Test-WWW-Mechanize-Mojo/t/white_label.t

 my $root = "http://localhost";
 
 my $t = Test::Mojo->new();
-my $m = Test::WWW::Mechanize::Mojo->new( _tester => $t,);
+my $m = Test::WWW::Mechanize::Mojo->new( tester => $t,);
 
 $m->host('foo.com');
 # TEST
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.