Skip to content

Commit

Permalink
Improve docs for Expectation#with when passed block
Browse files Browse the repository at this point in the history
Addressed an aside in the description of #682. This originally came up
in this commit [1].

[1]: 73c4ea6
  • Loading branch information
floehopper committed Dec 8, 2024
1 parent 3ca865f commit 17a4856
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mocha/expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def at_most_once
# May be used with Ruby literals or variables for exact matching or with parameter matchers for less-specific matching, e.g. {ParameterMatchers#includes}, {ParameterMatchers#has_key}, etc. See {ParameterMatchers} for a list of all available parameter matchers.
#
# Alternatively a block argument can be passed to {#with} to implement custom parameter matching. The block receives the +*actual_parameters+ as its arguments and should return +true+ if they are acceptable or +false+ otherwise. See the example below where a method is expected to be called with a value divisible by 4.
# The block argument takes precedence over +expected_parameters_or_matchers+.
# The block argument takes precedence over +expected_parameters_or_matchers+. The block may be called multiple times per invocation of the expected method and so it should be idempotent.
#
# Note that if {#with} is called multiple times on the same expectation, the last call takes precedence; other calls are ignored.
#
Expand Down

0 comments on commit 17a4856

Please sign in to comment.