Skip to content

Instantly share code, notes, and snippets.

@SysPete
Last active April 5, 2016 08:37
Show Gist options
  • Save SysPete/c85c3dcfe89f02cd41139b4cb4aeced4 to your computer and use it in GitHub Desktop.
Save SysPete/c85c3dcfe89f02cd41139b4cb4aeced4 to your computer and use it in GitHub Desktop.
=head3 Config becomes immutable
The plugin's C<config> attribute is loaded lazily on the first call to
C<config>. After this first call C<config> becomes immutable so you cannot
do the following in a test:
use Dancer2;
use Dancer2::Plugin::FooBar;
set plugins => {
FoorBar => {
wibble => 1, # this is OK
},
};
flibble(45); # plugin keyword called which causes config read
set plugins => {
FoorBar => {
wibble => 0, # this will NOT change plugin config
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment