[Catalyst-commits] r7726 - Catalyst-Runtime/5.80/branches/moose/t
konobi at dev.catalyst.perl.org
konobi at dev.catalyst.perl.org
Thu May 8 20:10:48 BST 2008
Author: konobi
Date: 2008-05-08 20:10:48 +0100 (Thu, 08 May 2008)
New Revision: 7726
Modified:
Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uploads.t
Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uri.t
Log:
Fix tests that were testing object internals instead of accessors.
Modified: Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uploads.t
===================================================================
--- Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uploads.t 2008-05-08 18:42:41 UTC (rev 7725)
+++ Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uploads.t 2008-05-08 19:10:48 UTC (rev 7726)
@@ -60,7 +60,7 @@
my $disposition = $part->header('Content-Disposition');
my %parameters = @{ ( split_header_words($disposition) )[0] };
- my $upload = $creq->{uploads}->{ $parameters{filename} };
+ my $upload = $creq->uploads->{ $parameters{filename} };
isa_ok( $upload, 'Catalyst::Request::Upload' );
@@ -68,7 +68,7 @@
is( $upload->size, length( $part->content ), 'Upload Content-Length' );
# make sure upload is accessible via legacy params->{$file}
- is( $creq->{parameters}->{ $upload->filename },
+ is( $creq->parameters->{ $upload->filename },
$upload->filename, 'legacy param method ok' );
ok( !-e $upload->tempname, 'Upload temp file was deleted' );
@@ -120,7 +120,7 @@
my $disposition = $part->header('Content-Disposition');
my %parameters = @{ ( split_header_words($disposition) )[0] };
- my $upload = $creq->{uploads}->{ $parameters{name} }->[$i];
+ my $upload = $creq->uploads->{ $parameters{name} }->[$i];
isa_ok( $upload, 'Catalyst::Request::Upload' );
is( $upload->type, $part->content_type, 'Upload Content-Type' );
@@ -220,7 +220,7 @@
is( $creq->content_length, $request->content_length,
'Catalyst::Request Content-Length' );
- my $param = $creq->{parameters}->{testfile};
+ my $param = $creq->parameters->{testfile};
ok( @$param == 2, '2 values' );
is( $param->[0], 'textfield value', 'correct value' );
@@ -233,7 +233,7 @@
next unless exists $parameters{filename};
- my $upload = $creq->{uploads}->{ $parameters{name} };
+ my $upload = $creq->uploads->{ $parameters{name} };
isa_ok( $upload, 'Catalyst::Request::Upload' );
Modified: Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uri.t
===================================================================
--- Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uri.t 2008-05-08 18:42:41 UTC (rev 7725)
+++ Catalyst-Runtime/5.80/branches/moose/t/live_engine_request_uri.t 2008-05-08 19:10:48 UTC (rev 7726)
@@ -62,8 +62,8 @@
ok( my $response = request('http://localhost/engine/request/uri?a=1;a=2;b=3'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
- is( $creq->{uri}->query, 'a=1;a=2;b=3', 'Query string ok' );
- is_deeply( $creq->{parameters}, $parameters, 'Parameters ok' );
+ is( $creq->uri->query, 'a=1;a=2;b=3', 'Query string ok' );
+ is_deeply( $creq->parameters, $parameters, 'Parameters ok' );
}
# test that query params are unescaped properly
@@ -71,8 +71,8 @@
ok( my $response = request('http://localhost/engine/request/uri?text=Catalyst%20Rocks'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
- is( $creq->{uri}->query, 'text=Catalyst%20Rocks', 'Query string ok' );
- is( $creq->{parameters}->{text}, 'Catalyst Rocks', 'Unescaped param ok' );
+ is( $creq->uri->query, 'text=Catalyst%20Rocks', 'Query string ok' );
+ is( $creq->parameters->{text}, 'Catalyst Rocks', 'Unescaped param ok' );
}
# test that uri_with adds params
More information about the Catalyst-commits
mailing list