documentation corrections and updates
[catagits/Web-Simple.git] / t / sub-dispatch-args.t
index 781fbf4..8762459 100644 (file)
@@ -12,20 +12,23 @@ use Test::More (
     use Web::Simple 't::Web::Simple::SubDispatchArgs';
     package t::Web::Simple::SubDispatchArgs;
 
+    has 'attr' => (is=>'ro');
+
     sub dispatch_request {
+        my $self = shift;
         sub (/) {
-            $_[0]->show_landing(@_);
+            $self->show_landing(@_);
         },
         sub(/...) {
             sub (GET + /user) {
-                $_[0]->show_users(@_);
+                $self->show_users(@_);
             },
             sub (/user/*) {
                 sub (GET) {
-                    $_[0]->show_user(@_);
+                    $self->show_user(@_);
                 },
                 sub (POST + %:id=&:@roles~) {
-                    $_[0]->process_post(@_);
+                    $self->process_post(@_);
                 }
             },
         }