Rafl: Switching to text template
parent
04a6925302
commit
7c245df230
|
@ -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
|
||||
|
|
22
t/Rafl.t
22
t/Rafl.t
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue