Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when using mocked methods #16

Closed
pjlsergeant opened this issue Aug 26, 2015 · 1 comment
Closed

Warning when using mocked methods #16

pjlsergeant opened this issue Aug 26, 2015 · 1 comment

Comments

@pjlsergeant
Copy link

perl -MPath::Class -MMock::Quick -e'my $x = qobj(foo => sub { print "My file is $_[1]" }); $x->foo( file(".") );'
Argument "." isn't numeric in numeric eq (==) at /Users/pjlsergeant/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Mock/Quick/Util.pm line 44.

https://github.com/exodist/Mock-Quick/blob/master/lib/Mock/Quick/Util.pm#L44

@exodist
Copy link
Owner

exodist commented Aug 26, 2015

There is a bug in your code, you should use qmeth instead of sub to add a custom sub to the object:

perl -MPath::Class -MMock::Quick -e'my $x = qobj(foo => qmeth { print "My file is $_[1]" }); $x->foo( file(".") );'

that said, the warning still occurs and needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants