This updates the stubbing logic to define its proxy method with
matching arity to the method being stubbed. This ensures that
singleton methods extended/inherited on a class will properly
check their arity. For these cases, assert will define a proxy
method that is aliased instead of using the inherited/extended
method when. This is because using the inherited/extended method
can effect other singletons and ensures assert is only modifying
the current object it is working on. Previously, the proxy method
was always defined to take any args, which had the side effect
of allowing any number of args when stubbing or calling the method.
This is against the spirit of assert's stubbing, so this updates
the proxy method to match the arity of the method it is proxying.
This allows the arity checking to properly ensure that a stub is
created or called with the proper number of args.
This updates the stubbing logic to define its proxy method with matching arity to the method being stubbed. This ensures that singleton methods extended/inherited on a class will properly check their arity. For these cases, assert will define a proxy method that is aliased instead of using the inherited/extended method when. This is because using the inherited/extended method can effect other singletons and ensures assert is only modifying the current object it is working on. Previously, the proxy method was always defined to take any args, which had the side effect of allowing any number of args when stubbing or calling the method. This is against the spirit of assert's stubbing, so this updates the proxy method to match the arity of the method it is proxying. This allows the arity checking to properly ensure that a stub is created or called with the proper number of args.
@kellyredding - Ready for review.