You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2002/08/24 18:12:57 UTC

cvs commit: modperl-2.0/t/directive perl.t

dougm       2002/08/24 09:12:57

  Modified:    lib/ModPerl TestRun.pm
  Added:       t/directive perl.t
  Log:
  add test for <Perl> sections
  
  Revision  Changes    Path
  1.2       +13 -0     modperl-2.0/lib/ModPerl/TestRun.pm
  
  Index: TestRun.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TestRun.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestRun.pm	14 May 2002 23:14:11 -0000	1.1
  +++ TestRun.pm	24 Aug 2002 16:12:57 -0000	1.2
  @@ -22,5 +22,18 @@
       $name eq 'mod_perl.c' ? 0 : 1;
   }
   
  +sub configure_startup_pl {
  +    my $self = shift;
  +
  +    $self->SUPER::configure_startup_pl;
  +
  +    #XXX: this should only be done for the modperl-2.0 tests
  +    $self->postamble(<<'EOF');
  +<Perl handler=ModPerl::Test::perl_section>
  +    $Foo = 'bar';
  +</Perl>
  +EOF
  +}
  +
   1;
   
  
  
  
  1.1                  modperl-2.0/t/directive/perl.t
  
  Index: perl.t
  ===================================================================
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  plan tests => 4;
  
  #so we don't have to require lwp
  my @auth = (Authorization => 'Basic ZG91Z206Zm9v'); #dougm:foo
  
  my $location = "/perl_sections/index.html";
  
  sok {
      ! GET_OK $location;
  };
  
  sok {
      my $rc = GET_RC $location;
      $rc == 401;
  };
  
  sok {
      GET_OK $location, @auth;
  };
  
  sok {
      ! GET_OK $location, $auth[0], $auth[1] . 'bogus';
  };