Hi Allan.

Den torsdag 17. juli 2014 skrev Allan Cochrane <[email protected]>
følgende:

> Hi,
>
> I'm trying to write continuous integration functional tests for one of my
> controllers in a full Mojolicious application.
>
> I'm trying to understand what mode (production, development, test) the
> application is started with when I do:
>
> sub get_test_app {
>   my $t = Test::Mojo->new('BrodieFull');
>
>   $t->app->mode('test');
>   $t->app->log->level('debug');
>   $t->ua->max_redirects(1);
>
>   return $t;
> }
>
> in my test file.
>
> I suspect it's 'development' but I'd like to make it 'test' so that my
> development database is not accidentally removed when I test the
> application (which doesn't impress your colleagues very much, or so I hear)
>
> I am using the Mojolicious::Config plugin to specify the database settings
> etc. but I can't seem to find a way to get it to read the file
> $moniker.test.conf (as in the docs:
> http://mojolicio.us/perldoc/Mojolicious/Plugin/Config) whilst functional
> testing. As you can see I force the mode but by then the configuration file
> has been read and declared missing by the plugin.
>
> How are other people doing this?
>
>
I'm setting the MOJO_MODE environment variable in a BEGIN { } block.




-- 
Pelle

Research is what I'm doing when I don't know what I'm doing.
- Wernher von Braun

-- 
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 http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to