t/002_index_route.t fails on an unmodified application
I get a weird failing test when I make a new and unmodified dancer application. t/002_index_route.t fails due to an unexpected "404 Not Found" (15:19:03)[~/source/webstuff]$ dancer -v Dancer 1.3011 (15:19:39)[~/source/webstuff]$ dancer -a testbug + testbug + testbug/bin + testbug/bin/app.pl + testbug/config.yml + testbug/environments + testbug/environments/development.yml + testbug/environments/production.yml + testbug/views + testbug/views/index.tt + testbug/views/layouts + testbug/views/layouts/main.tt + testbug/lib testbug/lib/ + testbug/lib/testbug.pm + testbug/public + testbug/public/css + testbug/public/css/style.css + testbug/public/css/error.css + testbug/public/images + testbug/public/500.html + testbug/public/404.html + testbug/public/dispatch.fcgi + testbug/public/dispatch.cgi + testbug/public/javascripts + testbug/public/javascripts/jquery.js + testbug/Makefile.PL + testbug/t + testbug/t/002_index_route.t + testbug/t/001_base.t (15:20:00)[~/source/webstuff]$ cd testbug (15:20:07)[~/source/webstuff/testbug]$ perl -Ilib t/002_index_route.t 1..2 ok 1 - a route handler is defined for / not ok 2 - response status is 200 for / # Failed test 'response status is 200 for /' # at /home/bnadland/perl5/lib/perl5/Dancer/Test.pm line 108. # got: '404' # expected: '200' # Looks like you failed 1 test of 2. But if I test this by Hand, I get the expected "200 OK": (15:20:21)[~/source/webstuff/testbug]$ perl bin/app.pl [28164] core @0.000079> loading Dancer::Handler::Standalone handler in /home/bnadland/perl5/lib/perl5/Dancer/Handler.pm l. 39 [28164] core @0.002450> loading handler 'Dancer::Handler::Standalone' in /home/bnadland/perl5/lib/perl5/Dancer.pm l. 230
Dancer 1.3011 server 28164 listening on http://0.0.0.0:3000 == Entering the development dance floor ... [28164] core @0.000872> request: GET / from 127.0.0.1 in /home/bnadland/perl5/lib/perl5/Dancer/Handler.pm l. 49 [28164] core @0.003825> [hit #1]trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [28164] core @0.005695> [hit #1] --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 [28164] core @0.245683> [hit #1]response: 200 in /home/bnadland/perl5/lib/perl5/Dancer/Handler.pm l. 131
(15:20:41)[~]$ echo "GET / HTTP/1.0\r\n\r\n" | nc localhost 3000 | grep HTTP HTTP/1.0 200 OK Any ideas what happens here? (I am a Perl/Dancer/Webdevelopment newbie and might be doing something stupid here. If that is the case I would also be glad to know.)
On Fri, Feb 18, 2011 at 03:40:35PM +0100, Benjamin Nadland wrote:
I get a weird failing test when I make a new and unmodified dancer application. [...] Any ideas what happens here?
(I am a Perl/Dancer/Webdevelopment newbie and might be doing something stupid here. If that is the case I would also be glad to know.)
weird. if i try this from the t/ directory, the test passes: (11:44:36)[~/source/webstuff/foobar/t]$ perl -I../lib 002_index_route.t 1..2 [20754] core @0.000058> trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [20754] core @0.001451> --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 ok 1 - a route handler is defined for / [20754] core @0.006864> [hit #2]trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [20754] core @0.007907> [hit #2] --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 ok 2 - response status is 200 for / Is there a recommended way to run the tests? I could not find anything in the documentation.
Hi Benjamin, I can see the reason you're experiencing this issue. I'm now raising it with the other devs to find out why it acts the way it does and whether we should change it. The reason you're failing is because Dancer::Test assumes you're running from inside the t/ directory. You can fix this by calling Dancer::Test as such: use Dancer::Test appdir => '.'; I want to fix it though so it doesn't happen at all. I'll be sure to update. Sawyer. On Sat, Feb 19, 2011 at 12:48 PM, Benjamin Nadland < benjamin.nadland@freenet.de> wrote:
On Fri, Feb 18, 2011 at 03:40:35PM +0100, Benjamin Nadland wrote:
I get a weird failing test when I make a new and unmodified dancer application. [...] Any ideas what happens here?
(I am a Perl/Dancer/Webdevelopment newbie and might be doing something stupid here. If that is the case I would also be glad to know.)
weird. if i try this from the t/ directory, the test passes:
(11:44:36)[~/source/webstuff/foobar/t]$ perl -I../lib 002_index_route.t 1..2 [20754] core @0.000058> trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [20754] core @0.001451> --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 ok 1 - a route handler is defined for / [20754] core @0.006864> [hit #2]trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [20754] core @0.007907> [hit #2] --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 ok 2 - response status is 200 for /
Is there a recommended way to run the tests? I could not find anything in the documentation. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Hello again! :) I fixed the issue in devel, it should be available in the next release with all the other goodies we've worked on. Thanks so much for the report! Sawyer. On Sun, Feb 20, 2011 at 2:43 PM, sawyer x <xsawyerx@gmail.com> wrote:
Hi Benjamin,
I can see the reason you're experiencing this issue. I'm now raising it with the other devs to find out why it acts the way it does and whether we should change it.
The reason you're failing is because Dancer::Test assumes you're running from inside the t/ directory. You can fix this by calling Dancer::Test as such: use Dancer::Test appdir => '.';
I want to fix it though so it doesn't happen at all.
I'll be sure to update. Sawyer.
On Sat, Feb 19, 2011 at 12:48 PM, Benjamin Nadland < benjamin.nadland@freenet.de> wrote:
On Fri, Feb 18, 2011 at 03:40:35PM +0100, Benjamin Nadland wrote:
I get a weird failing test when I make a new and unmodified dancer application. [...] Any ideas what happens here?
(I am a Perl/Dancer/Webdevelopment newbie and might be doing something stupid here. If that is the case I would also be glad to know.)
weird. if i try this from the t/ directory, the test passes:
(11:44:36)[~/source/webstuff/foobar/t]$ perl -I../lib 002_index_route.t 1..2 [20754] core @0.000058> trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [20754] core @0.001451> --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 ok 1 - a route handler is defined for / [20754] core @0.006864> [hit #2]trying to match `/' against /^\/$/ in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 74 [20754] core @0.007907> [hit #2] --> got 1 in /home/bnadland/perl5/lib/perl5/Dancer/Route.pm l. 81 ok 2 - response status is 200 for /
Is there a recommended way to run the tests? I could not find anything in the documentation. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
participants (2)
-
Benjamin Nadland -
sawyer x