File: warn_on_pathclass.t

package info (click to toggle)
libfile-sharedir-projectdistdir-perl 1.000004-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 400 kB
  • ctags: 22
  • sloc: perl: 442; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 687 bytes parent folder | download
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
use strict;
use warnings;

use Test::More;

# FILENAME: deprecate_path_class.t
# CREATED: 03/01/14 02:01:07 by Kent Fredric (kentnl) <kentfredric@gmail.com>
# ABSTRACT: Test for warnings about deprecated Path::Class

for my $package ( 'Path::Class', 'Capture::Tiny' ) {
  if ( not eval "require $package;1" ) {
    plan skip_all => "$package required for this test";
    done_testing;
    exit;
  }
}
pass('Test requirements available');
my $err = Capture::Tiny::capture_stderr(
  sub {
    eval '
        package Foo;
        use File::ShareDir::ProjectDistDir q[:all], pathclass => 1;
    ';
  }
);
like( $err, qr/Path::Class support depecated/, "Deprecated support" );
done_testing;