2016-02-20 18:32:40 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => "beam_me_up_scotty";
|
|
|
|
zci is_cached => 1;
|
|
|
|
|
2016-03-30 11:29:58 -07:00
|
|
|
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(@_)) }
|
|
|
|
|
2016-02-20 18:32:40 -08:00
|
|
|
ddg_goodie_test(
|
|
|
|
[qw( DDG::Goodie::BeamMeUpScotty )],
|
2016-03-30 11:29:58 -07:00
|
|
|
'beam me up scotty' => build_test(),
|
|
|
|
'beam us up scotty' => build_test(),
|
2016-02-20 18:32:40 -08:00
|
|
|
'beam me up' => undef,
|
|
|
|
'scotty beam us up' => undef,
|
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|