]> iEval git - html-element-library.git/blobdiff - t/content_handler.t
Refactor tests (first pass)
[html-element-library.git] / t / content_handler.t
index 8264d702f197c50ec8ed90de4329de2b20878490..5a2b203ee2c6e2cec383ce79f85dbb5f7cc84c61 100644 (file)
@@ -1,33 +1,15 @@
-use strict;
-use Test::More qw(no_plan);
+#!/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
 
-use HTML::Element::Library;
-
-
-my $t1;
-my $lol;
-$t1 = HTML::Element->new_from_lol
-  (
-   $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!');
 $t1->content_handler(corpus => 'all gone!');
-is( $t1->as_HTML, '<html><head><title>I like stuff!</title></head><body id="corpus" 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>', 'content_handler';
This page took 0.019067 seconds and 4 git commands to generate.