use strict; use warnings; use lib qw( ./lib ../lib ); use Test::More; use Cwd; use CSS::Inliner; plan(tests => 8); my $html = <<'END'; Test Document

Lorem ipsum dolor sit amet

Consectetur adipiscing elit

Aliquam ornare luctus egestas.

Nulla vulputate tellus vitae justo luctus scelerisque accumsan nunc porta.

Phasellus pharetra viverra sollicitudin. Vivamus ac enim ante.

Nunc augue massa, dictum id eleifend non posuere nec purus.

END my $inliner = CSS::Inliner->new(); $inliner->read({html => $html}); my $inlined = $inliner->inlinify(); ok($inlined =~ m/

Lorem ipsum/, 'h1.alert rule inlined'); ok($inlined =~ m/

Consectetur/, 'h1.cool rule inlined'); ok($inlined =~ m/

Aliquam/, '.intro rule inlined'); ok($inlined =~ m/

Phasellus/, 'div p rule inlined'); ok($inlined =~ m/

Nunc augue/, 'div p rule inlined again'); ok($inlined =~ m/

Nulla/, 'no rule for just "p"'); ok($inlined !~ m/