File: build_args.t

package info (click to toggle)
libmoox-buildargs-perl 0.08-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: perl: 300; makefile: 2
file content (24 lines) | stat: -rwxr-xr-x 364 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env perl
use 5.008001;
use strictures 2;
use Test2::V0;

{
    package Foo;
    use 5.008001;
    use strictures 2;

    use Moo;
    with 'MooX::BuildArgs';
    has get_bar => ( is=>'ro', init_arg=>'bar' );
    has baz => ( is=>'ro' );
}

my $obj = Foo->new( bar=>11, baz=>22 );

is(
    $obj->build_args(),
    { bar=>11, baz=>22 },
);

done_testing;