Variable method arity, like the following fails the expectation match:
def variable_arity(opt={})
Fails with MockExpectationError:variable_arityexpects -1 arguments, given 1 when argument provide, fails with MockExpectationError:variable_arityexpects -1 arguments, given 0 when left out.
Variable method arity, like the following fails the expectation match:
Fails with
MockExpectationError:
variable_arityexpects -1 arguments, given 1
when argument provide, fails withMockExpectationError:
variable_arityexpects -1 arguments, given 0
when left out.This is because
UnboundMethod
(returned by@const.instance_method(:method_name)
here: https://github.com/cfcosta/minitest-firemock/blob/master/lib/minitest/fire_mock.rb#L12) returns-n-1
for arguments wheren
equals the number of required arguments. See methodarity
under http://ruby-doc.org/core-2.2.0/UnboundMethod.html