trying to add more exceptions
This commit is contained in:
parent
ec3d2f1eb0
commit
309b16ca09
2 changed files with 31 additions and 3 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue