Remove useless whitespace
[gitmo/MooseX-Singleton.git] / t / 004-build_bug.t
CommitLineData
e2119ce9 1use strict;
2use warnings;
3
e01c7277 4use Test::More;
e2119ce9 5
6{
7 package MySingleton;
8 use MooseX::Singleton;
9
10 has 'attrib' =>
11 is => 'rw',
12 isa => 'Str',
13 default => 'foo';
14
15 sub hello {'world'}
16
17 sub BUILDARGS {
18 my ( $class, %opts ) = @_;
19
20 { attrib => 'bar', %opts };
21 }
22}
23
24is(
25 MySingleton->attrib, 'bar',
26 'BUILDARGS changed value of attrib when instance was auto-instantiated'
27);
28
29MySingleton->meta->remove_package_glob('singleton');
30
31MySingleton->instance;
32
33is(
34 MySingleton->attrib, 'bar',
35 'BUILDARGS changed value of attrib when instance was explicitly instantiated'
36);
e01c7277 37
38done_testing;