summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-08-02 10:27:19 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-08-02 10:27:19 +0200
commitc6dd17a1435db36eeaff24e40a7cc212ee7214a0 (patch)
tree15502debbc8827e3d917d6a498723abb40a3c73e /tests
parent9b6dc4d5d83f8acbd82459a0296eb256f632ea02 (diff)
Using SimpleContext in SimpleMustache's setTemplate, as it reads from a Handle using readU8. We'll switch readU8 to use a Future.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-Http.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/test-Http.cc b/tests/test-Http.cc
index cd183ce..1ea040b 100644
--- a/tests/test-Http.cc
+++ b/tests/test-Http.cc
@@ -25,13 +25,20 @@ const char htmlTemplateStr[] =
"</html>\n"
;
-class TestHtmlTemplate : public AtStart {
- public:
- TestHtmlTemplate() : AtStart(10), htmlTemplate(m_template) { }
- virtual void doStart() { m_template.setTemplate(htmlTemplateStr); }
+class TestHtmlTemplateTask : public Task {
+ virtual void Do() { m_template.setTemplate(htmlTemplateStr); }
+ virtual const char * getName() const { return "TestHtmlTemplateTask"; }
+ SimpleMustache & m_template;
+public:
+ TestHtmlTemplateTask(SimpleMustache & htmlTemplate) : m_template(htmlTemplate) { }
+};
+class TestHtmlTemplate : public AtStartAsTask {
+ public:
+ TestHtmlTemplate() : AtStartAsTask(10), htmlTemplate(m_template) { }
+ virtual Task * createStartTask() { return new TestHtmlTemplateTask(m_template); }
const SimpleMustache & htmlTemplate;
- private:
+ public:
SimpleMustache m_template;
};