]> iEval git - html-element-library.git/blobdiff - t/crunch.t
Refactor tests (first pass)
[html-element-library.git] / t / crunch.t
index 627ef2a3d6320119d37942fce2fc83a21d38d95c..241cc3fb089e58c77e648e7f024eab3695e56305 100644 (file)
@@ -1,25 +1,6 @@
-# This might look like shell script, but it's actually -*- perl -*-
-use strict;use warnings;
+#!/usr/bin/perl
+use t::lib tests => 1;
 
-use File::Slurp qw/read_file/;
-use Test::More;
-
-use HTML::TreeBuilder;
-use HTML::Element::Library;
-use Test::XML;
-
-sub tage {
-
-  my $root = "t/html/crunch/crunch";
-
-  my $tree = HTML::TreeBuilder->new_from_file("$root.initial")->guts;
-
-  $tree->crunch(look_down => [ class => 'imageElement' ], leave => 1);
-
-  is_xml $tree->as_XML, scalar read_file("$root.exp"), 'XML for crunch';
-}
-
-
-tage();
-
-done_testing;
+my $tree = mktree 't/html/crunch.html';
+$tree->crunch(look_down => [ class => 'imageElement' ], leave => 1);
+isxml $tree, 't/html/crunch.exp', 'crunch';
This page took 0.023601 seconds and 4 git commands to generate.