diff --git a/lib/DDG/Goodie/JohnCena.pm b/lib/DDG/Goodie/JohnCena.pm new file mode 100644 index 00000000000..5e999e5d66a --- /dev/null +++ b/lib/DDG/Goodie/JohnCena.pm @@ -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; diff --git a/t/JohnCena.t b/t/JohnCena.t new file mode 100644 index 00000000000..d49d8134d86 --- /dev/null +++ b/t/JohnCena.t @@ -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;