Mojolicious::Plugin::Config and Test::Mojo

18 views
Skip to first unread message

Stefan Adams

unread,
Apr 21, 2020, 10:37:38 AM4/21/20
to mojolicious
Test::Mojo allows setting the config at initialization, but the way Mojolicious::Plugin::Config works, that doesn't allow the programmed defaults to get picked up, which means that it is necessary to define a complete configuration during testing.  Is that more desirable than allowing the defaults to get picked up during testing?

Илья

unread,
Apr 21, 2020, 11:38:26 AM4/21/20
to mojol...@googlegroups.com

I do it that way (pretty ugly, i know), but agree, it's annoying and I'll be much happier if Mojolicious::Plugin::Config will do deep merge

my $t = Test::Mojo->new('App');

my $config = $t->app->config;

... do something with config;

undef $t;

$t = Test::Mojo->new('App', $config);

... do tests

21.04.2020 17:37, Stefan Adams пишет:
Test::Mojo allows setting the config at initialization, but the way Mojolicious::Plugin::Config works, that doesn't allow the programmed defaults to get picked up, which means that it is necessary to define a complete configuration during testing.  Is that more desirable than allowing the defaults to get picked up during testing?
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFQzm63SW_9a0xDH_AkhQXaVBB3T-WRa77PaUgac2Q-6Pg%40mail.gmail.com.

Stefan Adams

unread,
Apr 21, 2020, 12:23:24 PM4/21/20
to mojolicious
Very interesting approach to addressing the issue, thank you for sharing!

Stefan Adams

unread,
Apr 22, 2020, 3:43:06 PM4/22/20
to mojolicious
This worked very well, thanks again!!
Reply all
Reply to author
Forward
0 new messages