File: 006-cooperative.t

package info (click to toggle)
libmoosex-singleton-perl 0.29-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 164 kB
  • ctags: 12
  • sloc: perl: 279; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use warnings;

use Test::More;

use Test::Requires {
    'MooseX::StrictConstructor' => 0.16,
    'Test::Fatal' => 0.001,
};

{
    package MySingleton;
    use Moose;
    use MooseX::Singleton;
    use MooseX::StrictConstructor;

    has 'attrib' => ( is => 'rw' );
}

like( exception {
    MySingleton->new( bad_name => 42 );
},
qr/Found unknown attribute/, 'singleton class also has a strict constructor');

done_testing;