Debian Codegraph @

t/plugin2/no-config.t

raw
1 use strict;
2 use warnings;
3
4 use Test::More tests => 1;
5
6 BEGIN {
7 package Dancer2::Plugin::Foo;
8
9 use Dancer2::Plugin;
10
11 has bar => (
12 is => 'ro',
13 from_config => 1,
14 );
15
16 has baz => (
17 is => 'ro',
18 default => sub { $_[0]->config->{baz} },
19 );
20
21 plugin_keywords qw/ bar baz /;
22
23 }
24
25 {
26 package MyApp;
27
28 use Dancer2;
29 use Dancer2::Plugin::Foo;
30
31 bar();
32
33 baz();
34
35 }
36
37 pass "we survived bar() and baz()";
38