File: 02_main.t

package info (click to toggle)
libfile-find-rule-perl-perl 1.09-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 208 kB
  • ctags: 115
  • sloc: perl: 1,529; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 907 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
#!/usr/bin/perl -w

# Testing for File::Find::Rule::Perl

use strict;
use lib ();
use File::Spec::Functions ':ALL';
BEGIN {
	$| = 1;
	unless ( $ENV{HARNESS_ACTIVE} ) {
		require FindBin;
		$FindBin::Bin = $FindBin::Bin; # Avoid a warning
		chdir catdir( $FindBin::Bin, updir() );
		lib->import(
			catdir('blib', 'arch'),
			catdir('blib', 'lib' ),
			catdir('lib'),
			);
	}
}

use Test::More tests => 7;
use File::Find::Rule       ();
use File::Find::Rule::Perl ();
use constant FFR => 'File::Find::Rule';

# Check the methods are added
foreach my $method ( qw{ perl_file perl_module perl_script perl_test perl_installer } ) {
	ok( FFR->can($method), "->$method exists" );
}

# Make an object containing all of them
my $Rule = File::Find::Rule->new->perl_file;
isa_ok( $Rule, 'File::Find::Rule' );

my $Rule1 = File::Find::Rule->perl_file; #used in perlver
isa_ok( $Rule1, 'File::Find::Rule' );

exit(0);