-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
Description
It looks like mock 'class' does not delegate to mock_class.
mock_class:
perl -E 'use Test2::V0; use Test2::Tools::Mock qw(mock_class); my $mock = mock_class q/Some::Class/, ( add => [ new_method => sub { say "new_method"; } ] ); Some::Class->new_method; '
new_method
mock 'class':
$ perl -E 'use Test2::V0; my $mock = mock q/class/, q/Some::Class/, ( add => [ new_method => sub { say "new_method"; } ] ); Some::Class->new_method; '
Not currently building a mock at -e line 1.
May mock 'class' be delegate to mock_do?
test-more/lib/Test2/Tools/Mock.pm
Lines 128 to 129 in 8e80a95
| croak "Not currently building a mock" | |
| unless @BUILD; |
Version
perl -V
Summary of my perl5 (revision 5 version 40 subversion 0) configuration:
Platform:
osname=linux
osvers=6.5.0-1025-azure
archname=x86_64-linux-gnu
uname='linux buildkitsandbox 6.5.0-1025-azure #26~22.04.1-ubuntu smp thu jul 11 22:33:04 utc 2024 x86_64 gnulinux '
config_args='-Darchname=x86_64-linux-gnu -Duse64bitall -Duseshrplib -Dvendorprefix=/usr/local -des'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='cc'
ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
optimize='-O2'
cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='12.2.0'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib /usr/lib64
libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc
libc=/lib/x86_64-linux-gnu/libc.so.6
so=so
useshrplib=true
libperl=libperl.so
gnulibc_version='2.36'
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=so
d_dlsymun=undef
ccdlflags='-Wl,-E -Wl,-rpath,/usr/local/lib/perl5/5.40.0/x86_64-linux-gnu/CORE'
cccdlflags='-fPIC'
lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_LONG_DOUBLE
HAS_STRTOLD
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_SIPHASH13
PERL_HASH_USE_SBOX32
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Built under linux
Compiled at Dec 25 2024 01:16:31
@INC:
/usr/local/lib/perl5/site_perl/5.40.0/x86_64-linux-gnu
/usr/local/lib/perl5/site_perl/5.40.0
/usr/local/lib/perl5/vendor_perl/5.40.0/x86_64-linux-gnu
/usr/local/lib/perl5/vendor_perl/5.40.0
/usr/local/lib/perl5/5.40.0/x86_64-linux-gnu
/usr/local/lib/perl5/5.40.0
$ perl -E 'use Test2::V0; say $Test2::V0::VERSION; '
1.302209
Reactions are currently unavailable