Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (21 sloc) 547 Bytes
use strict;
use warnings;
use Test::More tests => 3;
use Test::MockObject;
my @list;
my $mock = Test::MockObject->new;
$mock->mock( enqueue => sub { push @list, @_ } );
$mock->mock( dequeue => sub { shift @list } );
# Complex code follows
# Complex code ends
my %call;
$call{$name}++ while (my $name = $mock->next_call);
is( $call{enqueue}, $call{dequeue},
"Enqueue and dequeue call an equal number of times");