]> iEval git - html-element-library.git/blobdiff - t/unroll_select.t
Refactor tests (first pass)
[html-element-library.git] / t / unroll_select.t
index a21c712fbe05d9cbd715e683a3c75301ce2c68dd..d29870a014415e097089fc2fe51ad2619849ebf8 100644 (file)
@@ -1,31 +1,17 @@
-# This might look like shell script, but it's actually -*- perl -*-
-use strict;
-use lib qw(t/ t/m/);
-
-
-use File::Slurp;
-use Test::More qw(no_plan);
-
-use HTML::TreeBuilder;
-use HTML::Element::Library;
-use Test::XML;
+#!/usr/bin/perl
+use t::lib tests => 1;
+use lib 't';
 
 use SelectData;
 
-my $root = 't/html/unroll_select';
-
-my $tree = HTML::TreeBuilder->new_from_file("$root.html");
-
+my $tree = mktree 't/html/unroll_select.html';
 
-$tree->unroll_select
- (
-   select_label     => 'clan_list', 
-   option_value     => sub { my $row = shift; $row->{clan_id} },
-   option_content   => sub { my $row = shift; $row->{clan_name} },
-   option_selected  => sub { my $row = shift; $row->{selected} },
-   data             => SelectData->load_data,
-   data_iter        => sub { my $data = shift; shift @$data }
-  );
+$tree->unroll_select(
+       select_label     => 'clan_list',
+       option_value     => sub { my $row = shift; $row->{clan_id} },
+       option_content   => sub { my $row = shift; $row->{clan_name} },
+       option_selected  => sub { my $row = shift; $row->{selected} },
+       data             => SelectData->load_data,
+       data_iter        => sub { my $data = shift; shift @$data });
 
-is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), 
-      "HTML for non-alternating table");
+isxml ($tree, 't/html/unroll_select.exp', 'unroll_select');
This page took 0.021544 seconds and 4 git commands to generate.