File: 04_export.t

package info (click to toggle)
libobject-container-perl 0.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 220 kB
  • sloc: perl: 221; makefile: 5
file content (20 lines) | stat: -r--r--r-- 361 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
use Test::Base;

plan 'no_plan';

use Object::Container 'obj';

{
    package Foo;
    sub new { bless {}, shift }
    sub hello { 'hello' }
}

obj->register( foo => sub { Foo->new } );

isa_ok( obj('foo'), 'Foo' );
isa_ok( obj->get('foo'), 'Foo' );
is( obj('foo')->hello, 'hello', 'hello method ok');
is( obj->get('foo')->hello, 'hello', 'hello method ok');