Add a failing test for behavior if you have a local BUILD method in your class
[gitmo/MooseX-Emulate-Class-Accessor-Fast.git] / t / BUILD_in_local_class.t
1 {
2     package My::Class;
3     use Moose;
4     use namespace::clean -except => 'meta';
5
6     with 'MooseX::Emulate::Class::Accessor::Fast';
7
8     sub BUILD {
9         my ($self, $args) = @_;
10         return $self;
11     }
12
13     __PACKAGE__->meta->make_immutable;
14 }
15
16 use Test::More tests => 1;
17 my $i = My::Class->new(totally_random_not_an_attribute => 1);
18 is $i->{totally_random_not_an_attribute}, 1, 'Unknown attrs get into hash';
19