irccd  3.0.3
js_plugin_fixture.hpp
1 /*
2  * js_plugin_fixture.hpp -- test fixture helper for Javascript plugins
3  *
4  * Copyright (c) 2013-2019 David Demelier <markand@malikania.fr>
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef IRCCD_TEST_JS_PLUGIN_FIXTURE_HPP
20 #define IRCCD_TEST_JS_PLUGIN_FIXTURE_HPP
21 
27 #include <irccd/daemon/bot.hpp>
28 
29 #include <irccd/js/plugin.hpp>
30 
31 #include "mock_server.hpp"
32 
33 namespace irccd::test {
34 
41 protected:
42  boost::asio::io_service service_;
44  std::shared_ptr<js::plugin> plugin_;
45  std::shared_ptr<mock_server> server_;
46 
47 public:
53  js_plugin_fixture(std::string path);
54 };
55 
56 } // !irccd::test
57 
58 #endif // !IRCCD_TEST_JS_PLUGIN_FIXTURE_HPP
Irccd main instance.
Definition: bot.hpp:58
test fixture helper for Javascript plugins.
Definition: js_plugin_fixture.hpp:40
boost::asio::io_service service_
The I/O service.
Definition: js_plugin_fixture.hpp:42
std::shared_ptr< js::plugin > plugin_
The plugin to test.
Definition: js_plugin_fixture.hpp:44
daemon::bot bot_
The irccd instance.
Definition: js_plugin_fixture.hpp:43
std::shared_ptr< mock_server > server_
A mock server.
Definition: js_plugin_fixture.hpp:45
js_plugin_fixture(std::string path)
Namespace for unit tests.
Definition: broken_plugin.hpp:29