NAME
DDG::Test::Spice - Adds keywords to easily test Spice plugins.
VERSION
version 1009
DESCRIPTION
Installs functions for testing Spice.
Warning: Be aware that you only use this module inside your test files in t/.
EXPORTS FUNCTIONS
test_spice
Easy function to generate a DDG::ZeroClickInfo::Spice for the test. See "ddg_spice_test".
You can predefine parameters via "spice".
The first parameter gets treated as the call of the DDG::ZeroClickInfo::Spice
spice
You can predefine DDG::ZeroClickInfo::Spice parameters for usage in "test_spice".
This function can be used several times to change specific defaults on the fly.
ddg_spice_test
With this function you can easily generate a small own DDG::Block for testing your DDG::Spice alone or in combination with others.
ddg_spice_test(
[qw( DDG::Spice::MySpice )],
'myspice data' => test_spice('/js/spice/my_spice/data'),
'myspice data2' => test_spice('/js/spice/my_spice/data2'),
);
alt_to_test
Use this function to verify your spice's alt_to definitions:
alt_to_test('DDG::Spice::My::Spice', [qw(alt1 alt2 alt3)]);
This would check for the following:
callbacks 'ddg_spice_my_alt[123]'
paths '/js/spice/my/alt[123]/'
AUTHOR
DuckDuckGo <open@duckduckgo.com>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by DuckDuckGo, Inc. https://duckduckgo.com/.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004