Permalink
Browse files

added test for scalar exception test

  • Loading branch information...
daviddelikat committed Dec 13, 2011
1 parent e364012 commit 7120969ba2ed2cb304a882d9d734a5ef3b431eab
Showing with 12 additions and 1 deletion.
  1. +12 −1 t/Asset/Template.t
@@ -16,7 +16,7 @@ use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Asset::Template;
use Exception::Class;
use Test::More tests => 58; # increment this value for each test you create
use Test::More tests => 59; # increment this value for each test you create
use Test::Deep;
use Data::Dumper;
use Test::Exception;
@@ -311,3 +311,14 @@ throws_ok
'Parser not in config dies';
isa_ok $class->getParser( $session, 'WebGUI::Asset::Template::HTMLTemplateExpr'), 'WebGUI::Asset::Template::HTMLTemplateExpr', 'parser in config is created';

{
use Test::MockObject::Extends;
my $mockparser = Test::MockObject->new->mock( process => sub { $@ = "failed" } );
my $mockTemplate = Test::MockObject::Extends->new( $class )
->mock( get => sub { return '' } )
->mock( session => sub { return $session } )
->mock( getParser => sub { return $mockparser } )
;
is $mockTemplate->process, 'failed', 'handle non-reference exceeption';
}

0 comments on commit 7120969

Please sign in to comment.