Beam me up, Scotty!
parent
ea1f924c0f
commit
f5f9c0f15f
|
@ -0,0 +1,25 @@
|
|||
package DDG::Goodie::BeamMeUpScotty;
|
||||
# ABSTRACT: A Star Trek catchphrase
|
||||
|
||||
use DDG::Goodie;
|
||||
use strict;
|
||||
|
||||
zci answer_type => 'beam_me_up_scotty';
|
||||
zci is_cached => 1;
|
||||
|
||||
triggers start => 'beam me up scotty', 'beam us up scotty';
|
||||
|
||||
handle remainder => sub {
|
||||
return unless ($_ eq '');
|
||||
|
||||
my $answer = 'Aye, aye, captain.';
|
||||
|
||||
return $answer,
|
||||
structured_answer => {
|
||||
input => ['Beam me up, Scotty'],
|
||||
operation => 'Code phrase',
|
||||
result => $answer
|
||||
};
|
||||
};
|
||||
|
||||
1;
|
|
@ -0,0 +1,33 @@
|
|||
#!/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;
|
||||
|
||||
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' => undef,
|
||||
'scotty beam us up' => undef,
|
||||
);
|
||||
|
||||
done_testing;
|
Loading…
Reference in New Issue