Update test for exception handling

This commit is contained in:
Colin Kuskie 2010-05-13 21:05:53 -07:00
parent d690148c2c
commit 01ba8203c8

View file

@ -108,7 +108,7 @@ eval {
}; };
is( is(
$contentLastModified, 0, $contentLastModified, undef,
"Purged Linked Asset: getContentLastModified returns 0 when linked asset missing", "Purged Linked Asset: getContentLastModified returns 0 when linked asset missing",
); );
@ -122,10 +122,10 @@ init();
$snippet->trash(); $snippet->trash();
$snippet->purge(); $snippet->purge();
$shortcut = $shortcut->cloneFromDb(); $shortcut = eval { $shortcut->cloneFromDb(); };
ok( ok(
!defined $shortcut, Exception::Class->caught(),
"Purge Linked Asset: Shortcut is purged even though it's in the trash" "Purge Linked Asset: Shortcut is purged even though it's in the trash"
); );
@ -135,10 +135,10 @@ init();
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Test purging snippet purges shortcut also # Test purging snippet purges shortcut also
$snippet->purge; $snippet->purge;
$shortcut = $shortcut->cloneFromDb(); $shortcut = eval { $shortcut->cloneFromDb(); };
ok( ok(
!defined $shortcut, Exception::Class->caught(),
"Purge Linked Asset: Shortcut is not defined", "Purge Linked Asset: Shortcut is not defined",
); );