def test_writes_file_when_changed(self):
        writer = TemplateWriter(EurekaClientMock(),
                                self.template_file,
                                self.output_file)

        writer.write()

        self.assertFalse(writer.write())

        writer.rendered = "We fake the content of the previous render"

        self.assertTrue(writer.write())
    def test_writes_file(self):
        writer = TemplateWriter(EurekaClientMock(),
                                self.template_file,
                                self.output_file)

        rendered = writer.render()

        self.assertTrue(writer.write())

        self.assertEqual(rendered, open(self.output_file).read())