File: dir_contains_ok.t

package info (click to toggle)
libtest-files-perl 0.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: perl: 406; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 607 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
use strict;
use warnings
  FATAL    => qw( all ),
  NONFATAL => qw( deprecated exec internal malloc newline once portable redefine recursion uninitialized );

use Test::Expander -tempdir => {};

my $mockThis = mock $CLASS => (
  override => [
    _show_failure => sub {},
    _show_result  => sub { !@{ shift->diag } },
  ]
);

const my @FILE_LIST => ( qw( file0 file1 ) );
path( $TEMP_DIR )->child( $_ )->touch foreach @FILE_LIST;

plan( 2 );

ok(  $METHOD_REF->( $TEMP_DIR, \@FILE_LIST ), 'comparison performed' );
ok( !$METHOD_REF->( $TEMP_DIR, {} ),          'invalid arguments, comparison rejected' );