CSS-Inliner
view release on metacpan or search on metacpan
t/embedded_style_block.t view on Meta::CPAN
151617181920212223242526272829303132333435open
(
my
$fh
,
$result_file
) or
die
"can't open $result_file: $!!\n"
;
my
$correct_result
=
do
{
local
( $/ ) ; <
$fh
> } ;
my
$inliner
= CSS::Inliner->new();
eval
{
$inliner
->fetch_file({
url
=>
$test_url
});
};
## conditional test plan based on whether or not the endpoint can be reached - frequently can't by cpan testers
plan $@ ? (
skip_all
=>
'Connectivity for endpoint required for test cannot be established'
) : (
tests
=> 2);
my
$inlined
=
$inliner
->inlinify();
ok(
$inlined
eq
$correct_result
,
'result was correct'
);
$result_file
=
$html_path
.
'embedded_style_result_encoded.html'
;
open
(
$fh
,
$result_file
) or
die
"can't open $result_file: $!!\n"
;
$correct_result
=
do
{
local
( $/ ) ; <
$fh
> } ;
( run in 0.918 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )