]> iEval git - html-element-library.git/blobdiff - t/crunch.t
Refactor tests (first pass)
[html-element-library.git] / t / crunch.t
index 275a02163f9f5c0896b87d84f3c3ad9fbb043c75..241cc3fb089e58c77e648e7f024eab3695e56305 100644 (file)
@@ -1,29 +1,6 @@
-# This might look like shell script, but it's actually -*- perl -*-
-use strict;use warnings;
-use lib qw(t/ t/m/);
+#!/usr/bin/perl
+use t::lib tests => 1;
 
-use File::Slurp;
-use Test::More;
-
-use TestUtils;
-use HTML::TreeBuilder;
-use HTML::Element::Library;
-
-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);
-
-  my $generated_html = ptree($tree, "$root.gen");
-
-  is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML 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.018321 seconds and 4 git commands to generate.