Commit | Line | Data |
664c8612 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin qw/$Bin/; |
5 | use lib "$Bin/lib"; |
6 | |
7 | use Test::More tests => 6; |
8 | use Test::Exception; |
9 | |
10 | use SomeModelClass; |
11 | my $i = SomeModelClass->new; |
12 | |
13 | throws_ok { $i->say_hello(); } qr/Validation failed/; |
14 | throws_ok { $i->say_hello({}); } qr/Validation failed/; |
15 | throws_ok { $i->say_hello({name => 'Fred'}); } qr/Validation failed/; |
16 | my $r; |
17 | lives_ok { $r = $i->say_hello({type => 'say_hello', name => 'Fred'}); }; |
18 | ok $r; |
19 | is_deeply($r, { type => 'say_hello_response', body => "Hello Fred" }); |
20 | |