def METHOD_NAME(make_stubber, stub_runner, error_code, stop_on_method):
    eventbridge_client = boto3.client('events')
    eventbridge_stubber = make_stubber(eventbridge_client)
    event_rule_name = 'test-rule'
    lambda_func_name = 'test-func'
    with stub_runner(error_code, stop_on_method) as runner:
        runner.add(
            eventbridge_stubber.stub_remove_targets,
            event_rule_name, [lambda_func_name])
        runner.add(
            eventbridge_stubber.stub_delete_rule, event_rule_name)
    if error_code is None:
        scheduled_lambda.delete_event_rule(
            eventbridge_client, event_rule_name, lambda_func_name)
    else:
        with pytest.raises(ClientError) as exc_info:
            scheduled_lambda.delete_event_rule(
                eventbridge_client, event_rule_name, lambda_func_name)
            assert exc_info.value.response['Error']['Code'] == error_code