Rafl: Switching to text template

master
Rob Emery 2016-05-18 20:47:44 +01:00
parent 04a6925302
commit 7c245df230
2 changed files with 21 additions and 15 deletions

View File

@ -14,12 +14,14 @@ zci is_cached => 1;
handle remainder => sub {
my $fact = Acme::rafl::Everywhere->new->fact;
return $fact,
structured_answer => {
input => ['rafl'],
operation => 'rafl',
result => $fact,
};
return $fact, structured_answer => {
data => {
title => $fact
},
templates => {
group => 'text'
}
};
};
1 && "rafl"; # everywhere

View File

@ -10,19 +10,23 @@ zci answer_type => 'rafl';
zci is_cached => 1;
my $intro = re(qr/^rafl is so everywhere, /);
my @rafl = (
$intro,
structured_answer => {
input => ['rafl'],
operation => 'rafl',
result => $intro
sub build_test {
return test_zci($intro, structured_answer => {
data => {
title => $intro,
},
templates => {
group => 'text'
}
});
}
ddg_goodie_test(
[qw( DDG::Goodie::Rafl)],
'rafl' => test_zci(@rafl),
'rafl is everywhere' => test_zci(@rafl),
'where is rafl?' => test_zci(@rafl),
'rafl' => build_test(),
'rafl is everywhere' => build_test(),
'where is rafl?' => build_test(),
);
done_testing;