File: 02new.pm

package info (click to toggle)
libapache-ssllookup-perl 2.00-04-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 220 kB
  • sloc: perl: 209; makefile: 11; ansic: 10; sh: 5
file content (59 lines) | stat: -rwxr-xr-x 979 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package TestSSL::02new;

use strict;
use warnings FATAL => qw(all);

use Apache::Test qw(-withtestmore);

use Apache2::Const -compile => qw(OK);

sub handler {

  my $r = shift;

  plan $r, tests => 7;

  { 
    use_ok('Apache::SSLLookup');
  }

  { 
    can_ok('Apache::SSLLookup', 'new');
  }

  {
    eval { $r = Apache::SSLLookup->new() };

    like ($@,
          qr/Usage:/,
          'new() requires arguments');
  }

  {
    eval { $r = Apache::SSLLookup->new({}) };

    like ($@,
          qr/method `new' invoked by a `unknown' object with no `r' key/,
          'new() requires an object');
  }

  {
    eval { $r = Apache::SSLLookup->new(bless {}, 'foo') };

    like ($@,
          qr/method `new' invoked by a `foo' object with no `r' key/,
          'new() requires an Apache2::RequestRec object');
  }

  {
    $r = Apache::SSLLookup->new($r);

    isa_ok($r, 'Apache::SSLLookup');

    isa_ok($r, 'Apache2::RequestRec');
  }

  return Apache2::Const::OK;
}

1;