comparison tests/src/irccdctl/cli-plugin-unload/main.cpp @ 662:e9153b85b9bd

Tests: test irccdctl (plugin-* commands) #785 While here, fix many commands that were throwing invalid_message because of missing 'command' JSON property.
author David Demelier <markand@malikania.fr>
date Thu, 29 Mar 2018 09:13:51 +0200
parents
children a4082de4e94e
comparison
equal deleted inserted replaced
661:cab5cfba4c3b 662:e9153b85b9bd
1 /*
2 * main.cpp -- test irccdctl plugin-unload
3 *
4 * Copyright (c) 2013-2018 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 #define BOOST_TEST_MODULE "irccdctl plugin-unload"
20 #include <boost/test/unit_test.hpp>
21
22 #include <irccd/test/cli_test.hpp>
23
24 namespace irccd {
25
26 BOOST_FIXTURE_TEST_SUITE(plugin_unload_suite, cli_test)
27
28 BOOST_AUTO_TEST_CASE(simple)
29 {
30 run_irccd("irccd-plugins.conf");
31
32 {
33 const auto result = run_irccdctl({ "plugin-unload", "foo" });
34
35 BOOST_TEST(result.first.size() == 0U);
36 BOOST_TEST(result.second.size() == 0U);
37 }
38
39 {
40 const auto result = run_irccdctl({ "plugin-list" });
41
42 BOOST_TEST(result.first.size() == 2U);
43 BOOST_TEST(result.second.size() == 0U);
44 BOOST_TEST(result.first[0] == "bar");
45 }
46 }
47
48 BOOST_AUTO_TEST_SUITE_END()
49
50 } // !irccd