Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2759 from JoshuaRLi/master
Browse files Browse the repository at this point in the history
New JohnCena Goodie
  • Loading branch information
moollaza committed Mar 22, 2016
2 parents 547750b + 4d75f0b commit 5a65e74
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
43 changes: 43 additions & 0 deletions lib/DDG/Goodie/JohnCena.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package DDG::Goodie::JohnCena;
# ABSTRACT: WHO IS CHAMP? A simple instant answer that informs people of who the champ really is.
# See https://duck.co/ia/view/john_cena

use strict;
use DDG::Goodie;

triggers start =>
"who is champ",
"who's champ",
"wrestler meme",
"wwe meme",
"john cena",
"and his name is";

zci answer_type => 'john_cena';
zci is_cached => 1;

handle remainder => sub {

return if $_;

my $answer = 'JOHN CENA';

return $answer,
structured_answer => {
id => 'john_cena',
name => 'Answer',
data => {
title => $answer,
subtitle => 'YOUR TIME IS UP, MY TIME IS NOW'
},
meta => {
sourceName => 'Wikipedia',
sourceUrl => 'https://en.wikipedia.org/wiki/John_Cena'
},
templates => {
group => 'text'
}
};
};

1;
35 changes: 35 additions & 0 deletions t/JohnCena.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;

zci answer_type => "john_cena";
zci is_cached => 1;

ddg_goodie_test(
['DDG::Goodie::JohnCena'],
'who is champ' => test_zci(
'JOHN CENA',
structured_answer => {
id => 'john_cena',
name => 'Answer',
data => {
title => 'JOHN CENA',
subtitle => 'YOUR TIME IS UP, MY TIME IS NOW'
},
meta => {
sourceName => 'Wikipedia',
sourceUrl => 'https://en.wikipedia.org/wiki/John_Cena'
},
templates => {
group => 'text'
}
}
),
'who champ' => undef,
'famous wrestler' => undef,
);

done_testing;

0 comments on commit 5a65e74

Please sign in to comment.