trying to add more exceptions

This commit is contained in:
JT Smith 2008-03-19 23:23:51 +00:00
parent ec3d2f1eb0
commit 309b16ca09
2 changed files with 31 additions and 3 deletions

View file

@ -21,6 +21,8 @@ use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
use WebGUI::Asset;
use WebGUI::Shop::Cart;
use WebGUI::TestException;
#----------------------------------------------------------------------------
# Init
@ -30,11 +32,21 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
plan tests => 19; # Increment this number for each test you create
plan tests => 20; # Increment this number for each test you create
#----------------------------------------------------------------------------
# put your tests here
throws_deeply ( sub { my $cart = WebGUI::Shop::Cart->newBySession(); },
'WebGUI::Error::InvalidObject',
{
error => 'Needs a session.',
got => '',
expected => 'WebGUI::Session',
},
'newBySession takes an exception to not giving it a session variable'
);
my $cart = WebGUI::Shop::Cart->getCartBySession($session);
isa_ok($cart, "WebGUI::Shop::Cart");