comparison tests/src/libirccd/command-plugin-info/main.cpp @ 757:97b356010785

Irccd: create (command|jsapi)::registry Make two list of constructor functions to initialize all command and all Javascript modules to avoid duplicating efforts in case of change. While here, update test fixtures to load all of them for simplicity.
author David Demelier <markand@malikania.fr>
date Mon, 06 Aug 2018 21:27:00 +0200
parents c216d148558d
children 35c1517d705d
comparison
equal deleted inserted replaced
756:1b4f82c952d6 757:97b356010785
17 */ 17 */
18 18
19 #define BOOST_TEST_MODULE "plugin-info" 19 #define BOOST_TEST_MODULE "plugin-info"
20 #include <boost/test/unit_test.hpp> 20 #include <boost/test/unit_test.hpp>
21 21
22 #include <irccd/daemon/plugin_service.hpp> 22 #include <irccd/test/command_fixture.hpp>
23 23
24 #include <irccd/test/command_test.hpp> 24 namespace irccd::test {
25 #include <irccd/test/mock_plugin.hpp>
26
27 namespace irccd {
28 25
29 namespace { 26 namespace {
30 27
31 BOOST_FIXTURE_TEST_SUITE(plugin_info_test_suite, command_test<plugin_info_command>) 28 BOOST_FIXTURE_TEST_SUITE(plugin_info_test_suite, command_fixture)
32 29
33 BOOST_AUTO_TEST_CASE(basic) 30 BOOST_AUTO_TEST_CASE(basic)
34 { 31 {
35 daemon_->plugins().add(std::make_unique<mock_plugin>("test"));
36
37 const auto [json, code] = request({ 32 const auto [json, code] = request({
38 { "command", "plugin-info" }, 33 { "command", "plugin-info" },
39 { "plugin", "test" }, 34 { "plugin", "test" },
40 }); 35 });
41 36
75 70
76 BOOST_AUTO_TEST_SUITE_END() 71 BOOST_AUTO_TEST_SUITE_END()
77 72
78 } // !namespace 73 } // !namespace
79 74
80 } // !irccd 75 } // !irccd::test