]> iEval git - html-element-library.git/blobdiff - t/wrap_content.t
Refactor tests (first pass)
[html-element-library.git] / t / wrap_content.t
index 976420e2047f64180e9551c50892d709ff870185..7c766bcde64a4c98bdfa30b89f9d58cc582274bc 100644 (file)
@@ -1,38 +1,18 @@
-use strict;
-use Test::More qw(no_plan);
+#!/usr/bin/perl
+use t::lib tests => 1;
 
-use HTML::Element::Library;
-
-
-my $t1;
-my $lol;
-$t1 = HTML::Element->new_from_lol
-  (
-   $lol =
-   ['html',
-    ['head',
-     [ 'title', 'I like stuff!' ],
-    ],
-    ['body',
-     {
-      'lang', 'en-JP'},
-     'stuff',
-     ['p', 
-      ['span', {id => 'wrapme'},
-      'um, p < 4!', 
-       ],
-      {'class' => 'par123'}],
-     ['div', {foo => 'bar'}, '123'], # at 0.1.2
-     ['div', {jack => 'olantern'}, '456'], # at 0.1.2
-    ]
-   ]
-  )
-  ;
+my $t1 = HTML::Element->new_from_lol(
+       ['html',
+        ['head',
+         [ 'title', 'I like stuff!' ]],
+        ['body', {id => 'corpus'}, {'lang', 'en-JP'},
+         'stuff',
+         ['p', ['span', {id => 'wrapme'}, 'um, p < 4!'], {'class' => 'par123'}],
+         ['div', {foo => 'bar'}, '123'], # at 0.1.2
+         ['div', {jack => 'olantern'}, '456']]]); # at 0.1.2
 
 my $bold = HTML::Element->new('b', id => 'wrapper');
 
-my $W = $t1->look_down('id' => 'wrapme');
-$W->wrap_content($bold);
-is( $W->as_HTML, '<span id="wrapme"><b id="wrapper">um, p &lt; 4!</b></span>', "wrapped text");
-
-
+my $w = $t1->look_down('id' => 'wrapme');
+$w->wrap_content($bold);
+isxml $w, \'<span id="wrapme"><b id="wrapper">um, p &lt; 4!</b></span>', 'wrap_content';
This page took 0.01771 seconds and 4 git commands to generate.