Survey test suite added support for checking answer properties

This commit is contained in:
Patrick Donelan 2009-05-21 08:22:11 +00:00
parent f55559e124
commit 302e217e7a
2 changed files with 97 additions and 5 deletions

View file

@ -21,7 +21,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
plan tests => 79;
plan tests => 85;
my ( $s, $t1 );
@ -617,6 +617,38 @@ ok 1 - Valid sequences
ok 2 - Say my name
END_TAP
#########
# defined
#########
$spec = <<END_SPEC;
[
{
defined : {
S0Q0 : { answer: [ 'value', 'recordedAnswer' ] },
}
},
]
END_SPEC
try_it( $t1, $spec, { tap => <<END_TAP } );
1..1
ok 1 - Defined
END_TAP
$spec = <<END_SPEC;
[
{
defined : {
S0Q0 : { answer: [ 'value', 'recordedAnswer' ] },
'S1Q.' : { answer: [ 'value', 'recordedAnswer' ] },
}
},
]
END_SPEC
try_it( $t1, $spec, { tap => <<END_TAP, fail => 1 } );
1..1
not ok 1 - S1Q0 answer number 1 property recordedAnswer not defined
# got: ''
END_TAP
use TAP::Parser;
sub try_it {