Update Beam Me Up Scotty Goodie Re: #2767
parent
f92c75cf75
commit
ee172f8986
|
@ -16,9 +16,13 @@ handle remainder => sub {
|
||||||
|
|
||||||
return $answer,
|
return $answer,
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
input => ['Beam me up, Scotty'],
|
data => {
|
||||||
operation => 'Code phrase',
|
title => $answer,
|
||||||
result => $answer
|
subtitle => 'Code phrase: Beam me up, Scotty',
|
||||||
|
},
|
||||||
|
templates => {
|
||||||
|
group => 'text',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,24 +8,26 @@ use DDG::Test::Goodie;
|
||||||
zci answer_type => "beam_me_up_scotty";
|
zci answer_type => "beam_me_up_scotty";
|
||||||
zci is_cached => 1;
|
zci is_cached => 1;
|
||||||
|
|
||||||
|
sub build_structured_answer {
|
||||||
|
my $answer = 'Aye, aye, captain.';
|
||||||
|
return $answer,
|
||||||
|
structured_answer => {
|
||||||
|
data => {
|
||||||
|
title => $answer,
|
||||||
|
subtitle => 'Code phrase: Beam me up, Scotty',
|
||||||
|
},
|
||||||
|
templates => {
|
||||||
|
group => 'text',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub build_test { test_zci(build_structured_answer(@_)) }
|
||||||
|
|
||||||
ddg_goodie_test(
|
ddg_goodie_test(
|
||||||
[qw( DDG::Goodie::BeamMeUpScotty )],
|
[qw( DDG::Goodie::BeamMeUpScotty )],
|
||||||
'beam me up scotty' => test_zci(
|
'beam me up scotty' => build_test(),
|
||||||
'Aye, aye, captain.',
|
'beam us up scotty' => build_test(),
|
||||||
structured_answer => {
|
|
||||||
input => ['Beam me up, Scotty'],
|
|
||||||
operation => 'Code phrase',
|
|
||||||
result => 'Aye, aye, captain.'
|
|
||||||
}
|
|
||||||
),
|
|
||||||
'beam us up scotty' => test_zci(
|
|
||||||
'Aye, aye, captain.',
|
|
||||||
structured_answer => {
|
|
||||||
input => ['Beam me up, Scotty'],
|
|
||||||
operation => 'Code phrase',
|
|
||||||
result => 'Aye, aye, captain.'
|
|
||||||
}
|
|
||||||
),
|
|
||||||
'beam me up' => undef,
|
'beam me up' => undef,
|
||||||
'scotty beam us up' => undef,
|
'scotty beam us up' => undef,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue