File: css_url.t

package info (click to toggle)
libcss-inliner-perl 4024-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 412 kB
  • sloc: perl: 882; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl -w
use strict;
use warnings;
use lib qw( ./lib ../lib );

use Test::More;

use_ok( 'CSS::Inliner' );

my $inliner = new CSS::Inliner();

my $input = <<IN;
<html>
  <head>
    <style type="text/css">
    h4 {
	background-image: url(http://www.example.com/test.jpg);
       }</style>
  </head>
  <body>
  <h4>Test header with background</h4>
</body>
</html>
IN

$inliner->read({ html => $input });

my $actual = $inliner->inlinify();

ok ($actual =~ m{url\(http://www.example.com/test.jpg\)}, 'url in style');

done_testing;