File: path.t

package info (click to toggle)
libtest-mockfile-perl 0.037-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: perl: 4,110; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 470 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
#!/usr/bin/perl -w

use strict;
use warnings;

use Test2::Bundle::Extended;
use Test2::Tools::Explain;
use Test2::Plugin::NoWarnings;

use Test::MockFile qw< nostrict >;

my $path = '/some/nonexistant/path';
my $mock = Test::MockFile->file($path);

is( $mock->path(), $path, "$path is set when the file isn't there." );

open( my $fh, '>', $path ) or die;
print $fh "abc";
close $fh;

is( $mock->path(), $path, "$path is set when the file is there." );

done_testing();