Commit | Line | Data |
8eec3c69 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | |
6 | BEGIN { |
7 | eval "require MooseX::StrictConstructor; use Test::Exception; 1;"; |
4c256923 |
8 | plan skip_all => |
9 | 'This test requires MooseX::StrictConstructor and Test::Exception' |
8eec3c69 |
10 | if $@; |
11 | } |
12 | |
13 | plan 'no_plan'; |
14 | |
15 | { |
16 | package MySingleton; |
17 | use Moose; |
18 | use MooseX::Singleton; |
19 | use MooseX::StrictConstructor; |
20 | |
089ff853 |
21 | has 'attrib' => ( is => 'rw' ); |
8eec3c69 |
22 | } |
23 | |
24 | throws_ok { |
4c256923 |
25 | MySingleton->new( bad_name => 42 ); |
8eec3c69 |
26 | } |
4c256923 |
27 | qr/Found unknown attribute/, 'singleton class also has a strict constructor'; |