Commit | Line | Data |
---|---|---|
bbf62397 | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use Test::More; | |
7 | use Test::Fatal; | |
8 | ||
9 | { | |
10 | package Foo; | |
11 | use Moose; | |
12 | ||
13 | ::like( | |
14 | ::exception{ has foo => ( | |
15 | is => 'ro', | |
16 | lazy => 1, | |
17 | ); | |
18 | }, | |
19 | qr/\QYou cannot have a lazy attribute (foo) without specifying a default value for it/, | |
20 | 'lazy without a default or builder throws an error' | |
21 | ); | |
22 | } | |
23 | ||
24 | done_testing; |