File: sub-install.t

package info (click to toggle)
libnamespace-autoclean-perl 0.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 520 kB
  • sloc: perl: 580; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 401 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
use strict;
use warnings;
use Test::More 0.88;

{
    package Foo;
    use Test::Needs 'Sub::Install';
    sub bar { }

    Sub::Install::install_sub({
        code => sub { 'moo!' },
        into => __PACKAGE__,
        as   => 'moo',
    });

    use namespace::autoclean;
}

ok( Foo->can('bar'), 'Foo can bar - standard method');
ok( Foo->can('moo'), 'Foo can moo - installed sub');

done_testing;