Config overriding works only for full apps

#! /usr/bin/env perl use Mojo::Base-strict; use Test::More; use Test::Mojo; 
package Foo; use Mojo::Base'Mojolicious', -signatures; sub startup ($self) {
    $self->plugin(Config => {default => {jack => 'squat'}}); 
$self->routes->get('/')->to('main#index'); }

package Foo::Controller::Main; use Mojo::Base'Mojolicious::Controller', -signatures; sub index 
($c) {$c->render(text => $c->app->config->{jack}) }

package main; my $t = Test::Mojo->new(Foo => {jack => 'flack'}); $t->get_ok('/')
  ->content_is('flack')
  ->or(sub {say STDERR$t->app->dumper(shift->tx->res->body) }); done_testing();

On 27/09/2018 18:14, Scott Wiersdorf wrote:
I should have added that I’m running 8.01.


--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to