File: init_arg.t

package info (click to toggle)
libhtml-formfu-perl 2.07000-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 4,392 kB
  • sloc: perl: 12,777; makefile: 9; sql: 5
file content (22 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;

use Test::More tests => 3;
use Test::Exception;

use HTML::FormFu;

{

    package MyApp::FormFu;
    use Moose;
    extends 'HTML::FormFu';

    has 'my_attr' => ( is => 'ro', init_arg => 'mine' );
}

my $form;
lives_ok( sub { $form = MyApp::FormFu->new( mine => 'ok' ); },
    "form construction doesn't die" );
ok( $form, 'form constructed ok' );
is( $form->my_attr, 'ok', 'attribute set' );