use Some::Module; use Test::More tests => 2; { my $some_function_called; local *some_function = sub { $some_function_called++; return @canned_results; }; my @res = other_function_that_calls_some_function(); is $some_function_called, 1, 'We asked for resource existence'; is_deeply \@res, ['expected', 'results'], 'We got good results'; }