File: 01_devel.t

package info (click to toggle)
libfile-sharedir-projectdistdir-perl 1.000008-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 404 kB
  • ctags: 24
  • sloc: perl: 456; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 674 bytes parent folder | download | duplicates (2)
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
40

use strict;
use warnings;

use Test::More 0.96;
use FindBin;
use lib 't/lib';
use FakeFS;

my $fake;

BEGIN {
  $fake = FakeFS->new( root => "$FindBin::Bin/01_files" );
  $fake->add_file( '.devdir'           => q[] );
  $fake->add_file( 'share/file'        => q[01] );
  $fake->add_file( 'lib/Example_01.pm' => <<'EOF' );
use strict;
use warnings;

package Example_01;

use File::ShareDir::ProjectDistDir;

use Path::Tiny qw(path);

sub test {
  return scalar path( dist_file( 'Example_01', 'file' ) )->slurp();
}

1;
EOF
}
use lib "$FindBin::Bin/01_files/lib";

use Example_01;

is( Example_01->test(), '01', 'Example 01 returns the right shared value' );

done_testing;