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