You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here [...] denotes an optional part.
But it's hard for new users to guess the right syntax, as you suggest. I'll add more examples later.
[...]
This yields a message stating 42 does not equal [43], which may be misleading.
It is a separate issue. In that case, the meaning of "expected value" is varied for each custom matcher. It's not possible to output proper messages for all situations from vspec. So that it would be recommended to customize how to generate a failure message for the custom matcher.
The problem is that the default message generator doesn't make a reasonable message for custom matchers.
On the topic of the "match" Funcref in
{matcher}
, the help:h vspec#customize_matcher()
only states:The only examples of custom matchers in the help do not take any arguments. This leaves the syntax to be used undocumented.
:Expect x to_have_args [1, 2, 3]
, like for the built-incall()
?:Expect x to_have_args 1 2 3
, like for:command
, or in theshell?
:Expect x to_have_args 1, 2, 3
? (Yes.)Adding to this, I think it should also be documented that the arguments are implicitly a list. Consider this test:
This yields a message stating
42
does not equal[43]
, which may be misleading.The text was updated successfully, but these errors were encountered: