Skip to content

Commit

Permalink
added test for scalar exception test
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddelikat committed Dec 13, 2011
1 parent e364012 commit 7120969
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion t/Asset/Template.t
Expand Up @@ -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;
Expand Down Expand Up @@ -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.