]> iEval git - html-element-library.git/blobdiff - t/crunch.t
implement and test crunch method
[html-element-library.git] / t / crunch.t
diff --git a/t/crunch.t b/t/crunch.t
new file mode 100644 (file)
index 0000000..b4a42e3
--- /dev/null
@@ -0,0 +1,28 @@
+# This might look like shell script, but it's actually -*- perl -*-
+use strict;use warnings;
+use lib qw(t/ t/m/);
+
+use File::Slurp;
+use Test::More qw(no_plan);
+
+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();
+
This page took 0.020817 seconds and 4 git commands to generate.