def METHOD_NAME(self):
    """
    Adds stubbed responses until the specified method is encountered. The
    specified error code is added to the kwargs for the final method and no
    more responses are added to the stubbers. When no method is specified, all
    responses are added and the error code is not used.
    In this way, flexible tests can be written that both run successfully through
    all stubbed calls or raise errors and exit early.
    """
    for index, stub in enumerate(self.stubs):
        match = False
        if isinstance(self.stop_on_method, int):
            match = self.stop_on_method == index
        elif isinstance(self.stop_on_method, str):
            match = self.stop_on_method == stub['func'].__name__
        if match and not stub['keep_going']:
            stub['func_kwargs']['error_code'] = self.error_code
        stub['func'](*stub['func_args'], **stub['func_kwargs'])
        if (match and not stub['keep_going']
                and not stub['raise_and_continue']):
            break