Am Freitag, 7. Oktober 2016 21:52:26 UTC+2 schrieb petra:
>
> [...]
> And do instruction from this page 
> http://mojolicious.org/perldoc/Mojolicious/Guides/Growing
>
> But after section *Simplified application script *and running test, I got 
> such error:
>
> t/login.t .. Mojo::Reactor::Poll: I/O watcher failed: Can't call method 
> "build_tx" on an undefined value at C:/Perl64/site/lib/Mojo/Server.pm line 
> 23.
> # Premature connection close
>
> #   Failed test 'GET /'
> #   at t/login.t line 21. 
>

As far as I understand it, the problem is that "myapp.pl" at this step no 
longer implements the app by itself, but loads it from a module by its name.
The test file still expects to have access to the app by "require"ing the 
start script, but that no longer works.
In order to have the tests succeed again you have to tell Test::Mojo which 
app to load.
In other words:

Line 9 in login.t still reads:
my $t = Test::Mojo->new();

But you have to add the name of the app, so it reads:
my $t = Test::Mojo->new('MyApp');

HTH
- Heiko

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

Reply via email to