Mercurial > irccd
comparison tests/src/plugins/joke/main.cpp @ 722:3e816cebed2c
Irccd: make plugin pure abstract, closes #796 @3h
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 16 Jul 2018 21:19:47 +0200 |
parents | 152d20dc0e74 |
children | e8c4ba5ed1c6 |
comparison
equal
deleted
inserted
replaced
721:2fa1f2c898ee | 722:3e816cebed2c |
---|---|
24 namespace irccd { | 24 namespace irccd { |
25 | 25 |
26 class joke_test : public plugin_test { | 26 class joke_test : public plugin_test { |
27 public: | 27 public: |
28 joke_test() | 28 joke_test() |
29 : plugin_test(PLUGIN_NAME, PLUGIN_PATH) | 29 : plugin_test(PLUGIN_PATH) |
30 { | 30 { |
31 plugin_->set_formats({ | 31 plugin_->set_formats({ |
32 { "error", "error=#{server}:#{channel}:#{origin}:#{nickname}" } | 32 { "error", "error=#{server}:#{channel}:#{origin}:#{nickname}" } |
33 }); | 33 }); |
34 } | 34 } |
35 | 35 |
36 void load(plugin_config config = {}) | 36 void load(plugin::map config = {}) |
37 { | 37 { |
38 // Add file if not there. | 38 // Add file if not there. |
39 if (config.count("file") == 0) | 39 if (config.count("file") == 0) |
40 config.emplace("file", CMAKE_CURRENT_SOURCE_DIR "/jokes.json"); | 40 config.emplace("file", CMAKE_CURRENT_SOURCE_DIR "/jokes.json"); |
41 | 41 |
42 plugin_->set_config(config); | 42 plugin_->set_options(config); |
43 plugin_->handle_load(irccd_); | 43 plugin_->handle_load(irccd_); |
44 } | 44 } |
45 }; | 45 }; |
46 | 46 |
47 BOOST_FIXTURE_TEST_SUITE(joke_test_suite, joke_test) | 47 BOOST_FIXTURE_TEST_SUITE(joke_test_suite, joke_test) |