File: 02-map.t

package info (click to toggle)
libclass-loader-perl 2.03-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 88 kB
  • sloc: perl: 185; makefile: 2
file content (52 lines) | stat: -rwxr-xr-x 1,029 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -s
##
## Class::Loader Test Suite
##
## Copyright (c) 2001, Vipul Ved Prakash.  All rights reserved.
## This code is free software; you can redistribute it and/or modify
## it under the same terms as Perl itself.
##
## $Id: 02-map.t,v 1.1.1.1 2001/04/22 01:11:40 vipul Exp $

use lib '../lib', 'lib';
package Class::Loader::Test02;
use Class::Loader;
use vars qw(@ISA);
@ISA = (Class::Loader);

sub new { 

    my $self = { Method => 'new' };
    return bless $self, shift;

}

sub test { 

    my $self = shift;
    $self->_storemap ( 'URLFILTER' => { Module => "Class::LoaderTest",
                                        Constructor => "foo" } );

}

sub load {

    my $self = shift;
    $self->_load ( 'Handler', Name => 'URLFILTER' );

}

package main;

use Data::Dumper;
use Test;
BEGIN { plan tests => 3 };

my $test = new Class::Loader::Test02;
$test->test();
$test->load();
my $map = $test->_retrmap;
ok(1) if $map;
ok(ref $test->{Handler}, "Class::LoaderTest");
ok($test->{Handler}->{Method}, "foo");