]> iEval git - html-element-library.git/blobdiff - t/replace_content.t
Refactor tests (first pass)
[html-element-library.git] / t / replace_content.t
index 40b0b7e0af1854d0486752313fe3726f70c93158..4723593d3efc4ab021173060e015eab44b44a7fa 100644 (file)
@@ -1,32 +1,16 @@
-use strict;
-use Test::More qw(no_plan);
-
-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', 'um, p < 4!', {'class' => 'par123'}],
-     ['div', {foo => 'bar'}, '123'], # at 0.1.2
-     ['div', {jack => 'olantern'}, '456'], # at 0.1.2
-    ]
-   ]
-  )
-  ;
+#!/usr/bin/perl
+use t::lib tests => 1;
 
+my $t1 = HTML::Element->new_from_lol(
+       ['html',
+        ['head',
+         [ 'title', 'I like stuff!' ]],
+        ['body', {id => 'corpus'}, {'lang', 'en-JP'},
+         'stuff',
+         ['p', 'um, p < 4!', {'class' => 'par123'}],
+         ['div', {foo => 'bar'}, '123'], # at 0.1.2
+         ['div', {jack => 'olantern'}, '456']]]); # at 0.1.2
 
 $t1->look_down('_tag' => 'body')->replace_content('all gone!');
-is( $t1->as_HTML, '<html><head><title>I like stuff!</title></head><body lang="en-JP">all gone!</body></html>', "replaced all of body");
-
 
+isxml $t1, \'<html><head><title>I like stuff!</title></head><body id="corpus" lang="en-JP">all gone!</body></html>', 'replace_content';
This page took 0.024628 seconds and 4 git commands to generate.