def METHOD_NAME(out):
    out = Writer(out)
    includes = [
        'handler_test.h',
        'yaml-cpp/yaml.h',
        'gmock/gmock.h',
        'gtest/gtest.h',
    ]
    for include in includes:
        out.writeln('#include "%s"' % include)
    out.writeln('')
    usings = [
        '::testing::_',
    ]
    for using in usings:
        out.writeln('using %s;' % using)
    out.writeln('')
    with Scope(out, 'namespace YAML', 0) as _:
        with Scope(out, 'namespace', 0) as _:
            out.writeln('')
            out.writeln('typedef HandlerTest GenEmitterTest;')
            out.writeln('')
            tests = list(gen_tests())
            for test in tests:
                with Scope(out, 'TEST_F(%s, %s)' % ('GenEmitterTest', test['name']), 2) as _:
                    out.writeln('Emitter out;')
                    for event in test['events']:
                        emit = event['emit']
                        if isinstance(emit, list):
                            for e in emit:
                                out.writeln('out << %s;' % e)
                        elif emit:
                            out.writeln('out << %s;' % emit)
                    out.writeln('')
                    for event in test['events']:
                        handle = event['handle']
                        if handle:
                            out.writeln('EXPECT_CALL(handler, %s);' % handle)
                    out.writeln('Parse(out.c_str());')
                out.writeln('')