From 6096c9eef4aa2ffc6895c48c88008773a76d8a4b Mon Sep 17 00:00:00 2001 From: zekiel Date: Sat, 6 Dec 2014 20:02:54 +0000 Subject: [PATCH] Zac made a goodie during Quack and Hack 2014. --- lib/DDG/Goodie/IsAwesome/zekiel.pm | 25 +++++++++++++++++++++++++ t/IsAwesome/zekiel.t | 19 +++++++++++++++++++ t/Zekiel.t | 22 ++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 lib/DDG/Goodie/IsAwesome/zekiel.pm create mode 100644 t/IsAwesome/zekiel.t create mode 100644 t/Zekiel.t diff --git a/lib/DDG/Goodie/IsAwesome/zekiel.pm b/lib/DDG/Goodie/IsAwesome/zekiel.pm new file mode 100644 index 000000000..5beea6ffe --- /dev/null +++ b/lib/DDG/Goodie/IsAwesome/zekiel.pm @@ -0,0 +1,25 @@ +package DDG::Goodie::IsAwesome::zekiel; +# ABSTRACT: thejdeep's first Goodie ! + +use DDG::Goodie; + +zci answer_type => "is_awesome_zekiel"; +zci is_cached => 1; + +name "IsAwesome zekiel"; +description "My semi-first Goodie proving I too can build instant answers."; +primary_example_queries "duckduckhack zekiel"; +category "special"; +topics "special_interest", "geek"; +code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/zekiel.pm"; +attribution github => ["https://github.com/zekiel", "zekiel"], + twitter => "zacpappis"; + + +triggers start => "duckduckhack zekiel"; + +handle remainder => sub { + return if $_; + return "zekiel is awesome and has successfully completed the DuckDuckHack Goodie tutorial!"; +}; +1; \ No newline at end of file diff --git a/t/IsAwesome/zekiel.t b/t/IsAwesome/zekiel.t new file mode 100644 index 000000000..41c44c7f5 --- /dev/null +++ b/t/IsAwesome/zekiel.t @@ -0,0 +1,19 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "is_awesome_zekiel"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( + DDG::Goodie::IsAwesome::zekiel + )], + 'duckduckhack zekiel' => test_zci('zekiel is awesome and has successfully completed the DuckDuckHack Goodie tutorial!'), + 'duckduckhack zekiel is awesome' => undef, +); + +done_testing; diff --git a/t/Zekiel.t b/t/Zekiel.t new file mode 100644 index 000000000..a041aec39 --- /dev/null +++ b/t/Zekiel.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "zekiel"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( DDG::Goodie::Zekiel )], + # At a minimum, be sure to include tests for all: + # - primary_example_queries + # - secondary_example_queries + 'example query' => test_zci('query'), + # Try to include some examples of queries on which it might + # appear that your answer will trigger, but does not. + 'bad example query' => undef, +); + +done_testing;