use strict; use warnings; use Test::More tests => 4 + 1; # extra NoWarnings test use Test::NoWarnings; use HTML::Widget; use lib 't/lib'; use HTMLWidget::TestLib; { my $w = HTML::Widget->new; $w->element('Block'); my $f = $w->process; is( "$f", <
EOF } { my $w = HTML::Widget->new; my $e = $w->element('Block'); $e->element('Submit'); my $f = $w->process; is( "$f", <
EOF } { my $w = HTML::Widget->new; my $fs = $w->element('Fieldset'); $fs->element( 'Textfield', 'foo' ); my $f = $w->process; is( "$f", <
EOF } { my $w = HTML::Widget->new; $w->element( 'Fieldset', 'foo' ) ->legend( 'the legend of foo' ) ->element('Fieldset') ->legend( 'the legend of blank' ) ->element( 'Fieldset', 'baz' ) ->legend( 'the legend of baz' ) ->element( 'Textfield', 'bar' ); my $f = $w->process; is( "$f", <
the legend of foo
the legend of blank
the legend of baz
EOF }