tweak the {Ship,Pay}Driver tests a bit, looking for safe copies of data

This commit is contained in:
Colin Kuskie 2008-08-06 04:10:12 +00:00
parent c01d4e89c4
commit b47318c786
2 changed files with 9 additions and 3 deletions

View file

@ -279,8 +279,11 @@ is ($driver->get('label'), 'Fast and harmless', 'get the label e
my $optionsCopy = $driver->get;
$optionsCopy->{label} = 'And now for something completely different';
isnt ($driver->get('label'), 'And now for something completely different',
'hashref returned by get() is a copy of the internal hashref');
isnt(
$driver->get('label'),
'And now for something completely different',
'hashref returned by get() is a copy of the internal hashref'
);
#######################################################################
#

View file

@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 36;
my $tests = 37;
plan tests => 1 + $tests;
#----------------------------------------------------------------------------
@ -195,6 +195,9 @@ is (WebGUI::Shop::ShipDriver->getName($session), 'Shipper Driver', 'getName retu
is($driver->get('enabled'), 1, 'get the enabled entry from the options');
is($driver->get('label'), 'Slow and dangerous', 'get the label entry from the options');
my $optionsCopy = $driver->get();
$optionsCopy->{label} = 'fast and furious';
is($driver->get('label'), 'Slow and dangerous', 'get returns a safe copy of the options');
#######################################################################
#