Skip to content

Commit

Permalink
Merge 904182c into d7071fd
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Oct 12, 2018
2 parents d7071fd + 904182c commit f028591
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
25 changes: 20 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: perl
perl:
- "5.28"
- "5.26"
- "5.24"
- "5.22"
Expand All @@ -9,9 +10,23 @@ perl:
- "5.14"
- "5.12"
- "5.10"
- blead
- dev
sudo: false
before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init
- build-perl
- perl -V
- cpanm Test::Memory::Cycle Test::Taint
- eval $(curl https://travis-perl.github.io/init) --auto
- cpanm Test::Memory::Cycle Test::Taint || true
matrix:
allow_failures:
-
perl: blead
-
perl: dev
-
env: AUTHOR_TESTING=0 COVERAGE=1
perl: '5.26'
fast_finish: 'true'
include:
-
env: AUTHOR_TESTING=0 COVERAGE=1
perl: '5.26'
3 changes: 2 additions & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ on 'configure' => sub {
};

on 'develop' => sub {
requires "Code::TidyAll::Plugin::SortLines::Naturally" => "0.000003";
requires "Encode" => "0";
requires "Pod::Coverage::TrustPod" => "0";
requires "Test::Code::TidyAll" => "0.50";
Expand All @@ -67,5 +68,5 @@ on 'develop' => sub {
};

on 'develop' => sub {
recommends "Dist::Zilla::PluginBundle::Git::VersionManager" => "0.005";
recommends "Dist::Zilla::PluginBundle::Git::VersionManager" => "0.007";
};
3 changes: 3 additions & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ perl = 5.006
[Prereqs / TestRequires]
CGI = 4.32

[Prereqs / DevelopRequires]
Code::TidyAll::Plugin::SortLines::Naturally = 0.000003

[MetaProvides::Package]

31 changes: 18 additions & 13 deletions xt/author/live/encoding.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@ use strict;
use warnings;

use constant PAIRS => {
'https://www.tripadvisor.com/'
=> 'utf-8',
'http://www.liveinternet.ru/users/dashdi/blog'
=> 'UTF-8',
'https://www.tripadvisor.com/' => 'utf-8',
'http://www.liveinternet.ru/users/dashdi/blog' => 'cp1251',
};

use Encode;
use Test::More;
use Test::Needs 'LWP::Protocol::https';
use Test::RequiresInternet( 'www.tripadvisor.com' => 443, 'www.liveinternet.ru' => 80 );
use Test::RequiresInternet(
'www.tripadvisor.com' => 443,
'www.liveinternet.ru' => 80
);
use WWW::Mechanize;

my %pairs = %{+PAIRS};
my %pairs = %{ +PAIRS };
for my $url ( sort keys %pairs ) {
my $want_encoding = $pairs{$url};
subtest $url => sub {
my $want_encoding = $pairs{$url};

my $mech = WWW::Mechanize->new;
my $mech = WWW::Mechanize->new;

$mech->get( $url );
is( $mech->response->code, 200, "Fetched $url" );
$mech->get($url);
is( $mech->response->code, 200, "Fetched $url" );

like( $mech->res->content_charset, qr/$want_encoding/i,
" ... Got encoding $want_encoding" );
ok( Encode::is_utf8( $mech->content ), 'Got back UTF-8' );
like(
$mech->res->content_charset, qr/$want_encoding/i,
" ... Got encoding $want_encoding"
);
ok( Encode::is_utf8( $mech->content ), 'Got back UTF-8' );
};
}

done_testing();

0 comments on commit f028591

Please sign in to comment.