rafaeljusto / redigomock

Easy way to unit test projects using redigo library (Redis client in go)
MIT License
203 stars 27 forks source link

Suggested change for new release #9

Closed szank closed 9 years ago

szank commented 9 years ago

Hi Rafael, You have created 1.0 tag, so I can suggest slight modification to redigomock behaviour. We have discussed it before. If you force redigomock Do() command arguments to be matched only in the order they have been called ( overriding this issue https://github.com/rafaeljusto/redigomock/issues/1 ) you could simplify fuzzy/non fuzzy command matching, treating every command as it was a fuzzy one.

What do you think about this idea? I think that the current situation is a bit confusing: if there is no fuzzy mach, then arguments can be given in any order, but if there is at least one fuzzy matcher, then the argument order have to mach the one given in the mock command definition.

I am OK with leaving it as it is if you don't want to change it, and I will clarify documentation either way.

Best regards, Maciej

rafaeljusto commented 9 years ago

Sure! This should simplify the usage of the library.

Could you also rename the file fuzzyMatch.go and fuzzyMatch_test.go to fuzzy_match.go and fuzzy_match_test.go respectively? I would like to respect the Go's naming conventions.

Cheers! Rafael