Commit | Line | Data |
3ce51439 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
a62dcd43 |
6 | use Test::More tests => 3; |
3ce51439 |
7 | use Test::Exception; |
8 | |
9 | # This tests the error handling in Moose::Object only |
10 | |
11 | { |
12 | package Foo; |
13 | use Moose; |
14 | } |
15 | |
16 | throws_ok { Foo->new('bad') } qr/^\QSingle parameters to new() must be a HASH ref/, |
17 | 'A single non-hashref arg to a constructor throws an error'; |
a62dcd43 |
18 | throws_ok { Foo->new(undef) } qr/^\QSingle parameters to new() must be a HASH ref/, |
19 | 'A single non-hashref arg to a constructor throws an error'; |
3ce51439 |
20 | |
21 | throws_ok { Foo->does() } qr/^\QYou much supply a role name to does()/, |
22 | 'Cannot call does() without a role name'; |