Whoops, add the demo type library and the trivial test also
[catagits/CatalystX-DynamicComponent.git] / t / 08_types_in_model.t
CommitLineData
664c8612 1use strict;
2use warnings;
3
4use FindBin qw/$Bin/;
5use lib "$Bin/lib";
6
7use Test::More tests => 6;
8use Test::Exception;
9
10use SomeModelClass;
11my $i = SomeModelClass->new;
12
13throws_ok { $i->say_hello(); } qr/Validation failed/;
14throws_ok { $i->say_hello({}); } qr/Validation failed/;
15throws_ok { $i->say_hello({name => 'Fred'}); } qr/Validation failed/;
16my $r;
17lives_ok { $r = $i->say_hello({type => 'say_hello', name => 'Fred'}); };
18ok $r;
19is_deeply($r, { type => 'say_hello_response', body => "Hello Fred" });
20