diff --git a/Changes b/Changes index be9d8bcb..6fa9ab7d 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,10 @@ Revision history for WWW::Mechanize - We now consistently use our own die() method and therefore the onerror handler wherever possible (GH#80) (Julien Fiegehenn) + [TESTS] + - Add tests for field() when working on a diff --git a/t/field.t b/t/field.t index 7dcfe4be..7902c584 100644 --- a/t/field.t +++ b/t/field.t @@ -2,7 +2,7 @@ use warnings; use strict; -use Test::More tests => 14; +use Test::More; use URI::file; BEGIN { @@ -29,6 +29,10 @@ $mech->set_visible( [ radio => 'wongo!' ], 'boingo' ); is( $mech->value( 'wango' ), 'wongo!', 'wango changed' ); is( $mech->value( 'dingo', 2 ), 'boingo', 'dingo changed' ); +ok( ! $mech->value( 'textarea_name' ), 'textarea is empty' ); +$mech->field( 'textarea_name' => 'foobar' ); +is( $mech->value( 'textarea_name' ), 'foobar', 'textarea has been populated' ); + for my $name (qw/__no_value __value_empty/) { ok( ! $mech->value( $name ), "$name is empty" ) or diag $mech->field($name); $mech->field( $name, 'foo'); @@ -42,4 +46,6 @@ for my $name (qw/__value/) { } $mech->field( $name, 'foo'); is( $mech->value( $name ), 'foo', "$name changed" ); -} \ No newline at end of file +} + +done_testing; \ No newline at end of file