Skip to content
Browse files

Couple of explanatory comments.

  • Loading branch information...
1 parent 079c9e7 commit f0395fab149e372ed50070151613189c27be555d @jnthn committed Jul 16, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/Test/Mock.pm
View
6 lib/Test/Mock.pm
@@ -8,7 +8,11 @@ class Test::Mock::Log {
}
method called($name, :$times, :$with) {
+ # Extract calls of the matching name.
my @calls = @!log-entries.grep({ .<name> eq $name });
+
+ # If we've an argument filter, apply it; we smart-match
+ # everything but captures, which we eqv.
my $with-args-note = "";
if defined($with) {
if $with ~~ Capture {
@@ -19,6 +23,8 @@ class Test::Mock::Log {
}
$with-args-note = " with arguments matching $with.perl()";
}
+
+ # Enforce times parameter, if given.
if defined($times) {
my $times-msg =
$times == 0 ?? "never called $name" !!

0 comments on commit f0395fa

Please sign in to comment.
Something went wrong with that request. Please try again.