File: relative-args.t

package info (click to toggle)
librelative-perl 0.04-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 124 kB
  • ctags: 17
  • sloc: perl: 243; makefile: 38
file content (31 lines) | stat: -rw-r--r-- 996 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
#!perl -Tw
package BigApp::Report;
use strict;
use Test::More;
use lib "t";

plan tests => 7;

use_ok( "relative" );

# load modules with empty import lists
my @loaded = import relative Create => [], "::Tools", Publish => [], "::Utils";
is_deeply( 
    \@loaded, 
    [qw(BigApp::Report::Create  BigApp::Tools  BigApp::Report::Publish  BigApp::Utils)], 
    "check that the modules were correctly loaded"
);
ok( !exists $BigApp::Report::{new_report}, 
    "check that the function 'new_report' was not imported" );
ok( !exists $BigApp::Report::{render}, 
    "check that the function 'render' was not imported" );

# load modules with non-empty import lists
@loaded = import relative Create => ["new_report"], "::Tools", Publish => ["render"], "::Utils";
is_deeply( 
    \@loaded, 
    [qw(BigApp::Report::Create  BigApp::Tools  BigApp::Report::Publish  BigApp::Utils)], 
    "check that the modules were correctly loaded"
);
can_ok( __PACKAGE__, "new_report" );
can_ok( __PACKAGE__, "render" );