File: BUILD_in_local_class.t

package info (click to toggle)
libmoosex-emulate-class-accessor-fast-perl 0.009032-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 224; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
{
    package My::Class;
    use Moose;
    use namespace::clean -except => 'meta';

    with 'MooseX::Emulate::Class::Accessor::Fast';

    sub BUILD {
        my ($self, $args) = @_;
        return $self;
    }

    __PACKAGE__->meta->make_immutable;
}

use Test::More tests => 1;
my $i = My::Class->new(totally_random_not_an_attribute => 1);
is $i->{totally_random_not_an_attribute}, 1, 'Unknown attrs get into hash';