DDG
view release on metacpan or search on metacpan
lib/DDG/Test/Spice.pm view on Meta::CPAN
1;
__END__
=pod
=head1 NAME
DDG::Test::Spice - Adds keywords to easily test Spice plugins.
=head1 VERSION
version 1018
=head1 DESCRIPTION
Installs functions for testing Spice.
B<Warning>: Be aware that you only use this module inside your test files in B<t/>.
=head1 EXPORTS FUNCTIONS
=head2 test_spice
Easy function to generate a L<DDG::ZeroClickInfo::Spice> for the test. See
L</ddg_spice_test>.
You can predefine parameters via L</spice>.
The first parameter gets treated as the
L<call of the DDG::ZeroClickInfo::Spice|DDG::ZeroClickInfo::Spice/call>
=head2 spice
You can predefine L<DDG::ZeroClickInfo::Spice> parameters for usage in
L</test_spice>.
This function can be used several times to change specific defaults on the
fly.
=head2 ddg_spice_test
With this function you can easily generate a small own L<DDG::Block> for
testing your L<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'),
);
=head2 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]/'
=head1 AUTHOR
DuckDuckGo <open@duckduckgo.com>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by DuckDuckGo, Inc. L<https://duckduckgo.com/>.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
=cut
( run in 1.859 second using v1.01-cache-2.11-cpan-5837b0d9d2c )