Initial commit of MooseX::Singleton and MooseX::Service
[gitmo/MooseX-Singleton.git] / t / singleton.t
1 use Test::More tests => 2;
2
3 use strict;
4 use warnings;
5
6 {
7   package Foo::Singleton;
8
9   use Moose;
10
11   has gravy => (is => 'rw');
12
13   with qw/MooseX::Singleton/;
14 }
15
16 ok (Foo::Singleton->new,'new');
17
18 my $foo = Foo::Singleton->instance;
19
20 my $bar = Foo::Singleton->instance;
21
22 $foo->gravy ('sauce');
23
24 is ($bar->gravy,'sauce','singleton');
25