summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse-api/unittests/testNotifications.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/gentoobrowse-api/unittests/testNotifications.cpp b/gentoobrowse-api/unittests/testNotifications.cpp
index 81b28d0..45feb1a 100644
--- a/gentoobrowse-api/unittests/testNotifications.cpp
+++ b/gentoobrowse-api/unittests/testNotifications.cpp
@@ -2,6 +2,7 @@
#include <boost/test/unit_test.hpp>
#include "mockDefs.h"
+#include <definedDirs.h>
#include <fstream>
BOOST_GLOBAL_FIXTURE( Service );
@@ -17,10 +18,15 @@ isHtml(const std::string & body)
void
save(const std::string & name, Gentoo::EmailPtr e)
{
- std::ofstream text("/tmp/" + name + ".txt");
+ std::ofstream text((binDir / (name + ".txt")).string());
text << e->body[0]->payload;
- std::ofstream html("/tmp/" + name + ".html");
- html << e->body[1]->payload;
+
+ char buf[BUFSIZ];
+ sprintf(buf, "tidy --indent yes --wrap 0 -quiet -output %s/%s.html",
+ binDir.c_str(), name.c_str());
+ FILE * tidy = popen(buf, "w");
+ BOOST_REQUIRE_EQUAL(1, fwrite(e->body[1]->payload.c_str(), e->body[1]->payload.length(), 1, tidy));
+ BOOST_REQUIRE_EQUAL(0, pclose(tidy));
}
void