Skip to content

Commit

Permalink
Update basic.t -
Browse files Browse the repository at this point in the history
Add a new test for no_runmodes, which replaces dump_html when no run modes are provided.

Add a test using TestApp.pm to cater for the dump_html test.
  • Loading branch information
MartinMcGrath committed Jan 16, 2014
1 parent dcadc36 commit 08b75f1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions t/basic.t
@@ -1,6 +1,5 @@

use strict;
use Test::More tests => 110;
use Test::More tests => 112;

BEGIN{use_ok('CGI::Application');}

Expand Down Expand Up @@ -28,7 +27,8 @@ sub response_like {
}
# Instantiate CGI::Application
# run() CGI::Application object. Expect header + output dump_html()
# run() CGI::Application object.
# Expect header + output no_runmodes()
{
my $app = CGI::Application->new();
isa_ok($app, 'CGI::Application');
Expand All @@ -39,11 +39,29 @@ sub response_like {
response_like(
$app,
qr{^Content-Type: text/html},
qr/Query Environment:/,
qr/Error - No runmodes specified./,
'base class response',
);
}
# Instantiate CGI::Application
# run() CGI::Application sub-class.
# Expect header + output dump_html()
{
my $app = TestApp->new();
$app->query(CGI->new({'test_rm' => 'dump_html'}));
response_like(
$app,
qr{^Content-Type: text/html},
qr/Query Environment:/,
'dump_html class response'
);
}
# Instantiate CGI::Application sub-class.
# run() CGI::Application sub-class.
# Expect HTTP header + 'Hello World: basic_test'.
Expand Down

0 comments on commit 08b75f1

Please sign in to comment.