Update Beam Me Up Scotty Goodie Re: #2767

master
sagarwal 2016-03-30 18:29:58 +00:00
parent f92c75cf75
commit ee172f8986
2 changed files with 27 additions and 21 deletions

View File

@ -15,11 +15,15 @@ handle remainder => sub {
my $answer = 'Aye, aye, captain.';
return $answer,
structured_answer => {
input => ['Beam me up, Scotty'],
operation => 'Code phrase',
result => $answer
};
structured_answer => {
data => {
title => $answer,
subtitle => 'Code phrase: Beam me up, Scotty',
},
templates => {
group => 'text',
},
};
};
1;

View File

@ -8,24 +8,26 @@ use DDG::Test::Goodie;
zci answer_type => "beam_me_up_scotty";
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(
[qw( DDG::Goodie::BeamMeUpScotty )],
'beam me up scotty' => test_zci(
'Aye, aye, captain.',
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 scotty' => build_test(),
'beam us up scotty' => build_test(),
'beam me up' => undef,
'scotty beam us up' => undef,
);