'L{APIBuilder.build} writes an index file which includes the name of the
project specified.'

@doNotFailOnNetworkError
def test_build(self):

    stdout = BytesIO()
    self.patch(sys, 'stdout', stdout)
    projectName = 'Foobar'
    packageName = 'quux'
    projectURL = 'scheme:project'
    sourceURL = 'scheme:source'
    docstring = 'text    in    docstring'
    privateDocstring = 'should    also    appear    in    output'
    inputPath = FilePath(self.mktemp()).child(packageName)
    inputPath.makedirs()
    inputPath.child('__init__.py').setContent(u"def    foo():\n                '{}'\ndef    _bar():\n                '{}'".format(docstring, privateDocstring).encode('utf-8'))
    outputPath = FilePath(self.mktemp())
    builder = APIBuilder()
    builder.build(projectName, projectURL, sourceURL, inputPath, outputPath)
    indexPath = outputPath.child('index.html')
    self.assertTrue(indexPath.exists(), ('API    index    %r    did    not    exist.' % (outputPath.path,)))
    self.assertIn(('<a    href="%s">%s</a>' % (projectURL, projectName)), indexPath.getContent(), 'Project    name/location    not    in    file    contents.')
    quuxPath = outputPath.child('quux.html')
    self.assertTrue(quuxPath.exists(), ('Package    documentation    file    %r    did    not    exist.' % (quuxPath.path,)))
    self.assertIn(docstring, quuxPath.getContent(), 'Docstring    not    in    package    documentation    file.')
    self.assertIn(('<a    href="%s/%s">View    Source</a>' % (sourceURL, packageName)), quuxPath.getContent())
    self.assertIn(('<a    class="functionSourceLink"    href="%s/%s/__init__.py#L1">' % (sourceURL, packageName)), quuxPath.getContent())
    self.assertIn(privateDocstring, quuxPath.getContent())
    self.assertTrue(quuxPath.sibling('quux.foo.html').exists())
    self.assertEqual(stdout.getvalue(), '')
