Mercurial > irccd
diff tests/plugin-history/main.cpp @ 350:287e9ede5eef
Tests: unbreak some
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 14 Nov 2016 13:11:16 +0100 |
parents | 79d9840811a1 |
children | c6fbb6e0e06d |
line wrap: on
line diff
--- a/tests/plugin-history/main.cpp Sun Nov 13 20:59:45 2016 +0100 +++ b/tests/plugin-history/main.cpp Mon Nov 14 13:11:16 2016 +0100 @@ -22,7 +22,10 @@ #include <irccd/irccd.hpp> #include <irccd/server.hpp> -#include <irccd/service-plugin.hpp> +#include <irccd/service.hpp> +#include <irccd/path.hpp> + +#include "plugin-tester.hpp" using namespace irccd; @@ -47,20 +50,16 @@ } }; -class HistoryTest : public testing::Test { +class HistoryTest : public PluginTester { protected: - Irccd m_irccd; - PluginService &m_ps; - std::shared_ptr<ServerTest> m_server; std::shared_ptr<Plugin> m_plugin; public: HistoryTest() - : m_ps(m_irccd.plugins()) - , m_server(std::make_shared<ServerTest>()) + : m_server(std::make_shared<ServerTest>()) { - m_ps.setFormats("history", { + m_irccd.plugins().setFormats("history", { { "error", "error=#{plugin}:#{command}:#{server}:#{channel}:#{origin}:#{nickname}" }, { "seen", "seen=#{plugin}:#{command}:#{server}:#{channel}:#{origin}:#{nickname}:#{target}:%H:%M" }, { "said", "said=#{plugin}:#{command}:#{server}:#{channel}:#{origin}:#{nickname}:#{target}:#{message}:%H:%M" }, @@ -74,9 +73,9 @@ if (config.count("file") == 0) config.emplace("file", SOURCEDIR "/words.conf"); - m_ps.setConfig("history", config); - m_ps.load("history", PLUGINDIR "/history.js"); - m_plugin = m_ps.require("history"); + m_irccd.plugins().setConfig("history", config); + m_irccd.plugins().load("history", PLUGINDIR "/history.js"); + m_plugin = m_irccd.plugins().require("history"); } };