7912263f4821b2bfe21d30c5dad50c7ec907894e
[gitmo/MooseX-Singleton.git] / t / 006-cooperative.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 use Test::Requires {
7     'MooseX::StrictConstructor' => 0.09,
8     'Test::Fatal' => 0.001,
9 };
10
11 {
12     package MySingleton;
13     use Moose;
14     use MooseX::Singleton;
15     use MooseX::StrictConstructor;
16
17     has 'attrib' => ( is => 'rw' );
18 }
19
20 like( exception {
21     MySingleton->new( bad_name => 42 );
22 },
23 qr/Found unknown attribute/, 'singleton class also has a strict constructor');
24
25 done_testing;