File: default.t

package info (click to toggle)
libmoox-types-mooselike-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 192 kB
  • ctags: 14
  • sloc: perl: 492; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 389 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
{

  package MyObject;
  use Moo;
  use MooX::Types::MooseLike::Base qw<ArrayRef Int>;
  has attribute_with_a_default => (
    is      => 'ro',
    isa     => ArrayRef [Int],
    default => sub { [ 52, 27, 108 ] },
    );
}
use Test::More;
use Test::Fatal;

is_deeply(
  MyObject->new->attribute_with_a_default,
  [ 52, 27, 108 ],
  'Parameterized type with a default'
  );

done_testing;