Test::CallCounter - Count the number of method calling
use Test::CallCounter; my $counter = Test::CallCounter->new( 'LWP::UserAgent' => 'get' ); my $ua = LWP::UserAgent->new(); $ua->get('http://d.hatena.ne.jp/'); is($counter->count(), 1);
Test::CallCounter counts the number of method calling.
Make a instance of Test::CallCounter and hook $method_name method in $class_name to count calling method.
$method_name
$class_name
Get a calling count of $method_name.
Reset counter.
Tokuhiro Matsuno <tokuhirom@gmail.com>
Test::Mock::Guard
If you want to do more complex operation while monkey patching, see also Test::Resub.
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Test::CallCounter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::CallCounter
CPAN shell
perl -MCPAN -e shell install Test::CallCounter
For more information on module installation, please visit the detailed CPAN module installation guide.