ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
is( $response->content, ( $request->parts )[0]->content, 'Content' );
-
+
# XXX: no way to test that temporary file for this test was deleted
}
'Unserialize Catalyst::Request'
);
}
-
+
for my $file ( $creq->upload ) {
my $upload = $creq->upload($file);
SKIP:
is( $upload->size, length( $part->content ), 'Upload Content-Length' );
is( $upload->filename, 'catalyst_130pix.gif', 'Upload Filename' );
is( $upload->basename, 'catalyst_130pix.gif', 'Upload basename' );
-
+
SKIP:
{
if ( $ENV{CATALYST_SERVER} ) {
if ( $ENV{CATALYST_SERVER} ) {
skip 'Not testing for deleted file on remote server', 1;
}
+
+ # JNAP, I added the following line in order to properly let
+ # the $env go out of scope so that the associated tempfile
+ # would be deleted. I think somewhere Catalyst::Test closed
+ # over ENV and holds state until a new command is issues but
+ # I can't find it.
+
+ request GET 'http://localhost/';
ok( !-e $body->body->filename, 'Upload temp file was deleted' );
}
}
if ( $ENV{CATALYST_SERVER} ) {
skip 'Not testing uploadtmp on remote server', 14;
}
-
+
my $creq;
my $dir = "$FindBin::Bin/";