#include "gromacs/onlinehelp/helptopic.h"
#include "gromacs/onlinehelp/helpwritercontext.h"
#include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/file.h"
+#include "gromacs/utility/stringstream.h"
#include "gromacs/onlinehelp/tests/mock_helptopic.h"
#include "testutils/stringtest.h"
#include "testutils/testasserts.h"
-#include "testutils/testfilemanager.h"
namespace
{
public:
HelpTestBase();
- gmx::test::TestFileManager tempFiles_;
MockHelpTopic rootTopic_;
- std::string filename_;
- gmx::File helpFile_;
+ gmx::StringOutputStream helpFile_;
gmx::HelpWriterContext context_;
gmx::HelpManager manager_;
};
HelpTestBase::HelpTestBase()
: rootTopic_("", NULL, "Root topic text"),
- filename_(tempFiles_.getTemporaryFilePath("helptext.txt")),
- helpFile_(filename_, "w"),
context_(&helpFile_, gmx::eHelpOutputFormat_Console),
manager_(rootTopic_, context_)
{
ASSERT_NO_THROW_GMX(manager_.writeCurrentTopic());
helpFile_.close();
- checkFileContents(filename_, "HelpText");
+ checkText(helpFile_.toString(), "HelpText");
}
TEST_F(HelpTopicFormattingTest, FormatsSimpleTopic)