Commits

Anonymous committed db489a0

Got t/useragent.t to pass.

  • Participants
  • Parent commits be5c293

Comments (0)

Files changed (2)

Test-WWW-Mechanize-Mojo/t/lib/mojjy.pl

 
 get "/gzipped/" => \&_gzipped;
 
+
+get "/user_agent" => sub {
+    my $self = shift;
+    
+    my $agent = $self->req->headers->user_agent();
+    my $html = html($agent, $agent);
+    
+    $self->render_text($html);
+    $self->res->headers->content_type("text/html; charset=utf-8");
+    
+    return;
+};
+
 get '/:groovy' => sub {
     my $self = shift;
     $self->render_text($self->param('groovy'), layout => 'funky');

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

-#!perl -T
+#!perl
+
 use strict;
 use warnings;
-use lib 'lib';
+
+use Test::More tests => 2;
+
+use Test::Mojo;
+use Test::WWW::Mechanize::Mojo;
+
+require "t/lib/mojjy.pl";
+
 use Encode qw();
-use Test::More tests => 2;
-use lib 't/lib';
-use Test::WWW::Mechanize::Mojo 'Catty';
+
+use Test::WWW::Mechanize::Mojo;
 
 my $root = "http://localhost";
 my $agent = 'TestAgent/1.0';
-my $m = Test::WWW::Mechanize::Mojo->new(agent => $agent);
+my $t = Test::Mojo->new();
+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");