File: mock_builtin.t

package info (click to toggle)
libtest-expander-perl 2.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: perl: 457; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 528 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::Builder::Tester tests => 1;

use FindBin;
use lib "$FindBin::Bin/../../../..";

my $title = "mock 'close'";
use Test::Expander
  -builtins => { close => sub { $title } },
  -method   => 'my_func',
  -target   => 't::Test::Expander::NoCLASS::MyModule';

test_out( "ok 1 - $title" );
is( $METHOD_REF->(), $title, $title );
test_test( $title );

done_testing();