From f655f0ab81f1458b83e07a58e32fd40a37495731 Mon Sep 17 00:00:00 2001 From: ettienne Date: Fri, 10 Jul 2015 10:37:05 +0000 Subject: [PATCH] Tutorial completed --- lib/DDG/Goodie/IsAwesome/Sloff.pm | 37 +++++++++++++++++++++++++++++++ t/IsAwesome/Sloff.t | 17 ++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 lib/DDG/Goodie/IsAwesome/Sloff.pm create mode 100644 t/IsAwesome/Sloff.t diff --git a/lib/DDG/Goodie/IsAwesome/Sloff.pm b/lib/DDG/Goodie/IsAwesome/Sloff.pm new file mode 100644 index 000000000..8816abaed --- /dev/null +++ b/lib/DDG/Goodie/IsAwesome/Sloff.pm @@ -0,0 +1,37 @@ +package DDG::Goodie::IsAwesome::Sloff; +# ABSTRACT: Write an abstract here +# Start at https://duck.co/duckduckhack/goodie_overview if you are new +# to instant answer development + +use DDG::Goodie; +use strict; + +zci answer_type => "is_awesome_sloff"; +zci is_cached => 1; + +# Metadata. See https://duck.co/duckduckhack/metadata for help in filling out this section. +name "IsAwesome Sloff"; +description "My first goodie"; +primary_example_queries "duckduckhack sloff"; +# Uncomment and complete: https://duck.co/duckduckhack/metadata#category +category "special"; +# Uncomment and complete: https://duck.co/duckduckhack/metadata#topics +topics "special_interest"; +code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/Sloff.pm"; +attribution github => ["https://github.com/Sloff/", "Sloff"]; + +# Triggers +triggers start => "duckduckhack sloff"; + +# Handle statement +handle remainder => sub { + + # Return undef if there is something after the trigger + return if $_; + + # Normal return text + return "Ettienne Pitts is awesome and has successfully completed the DuckDuckHack Goodie tutorial!"; + +}; + +1; diff --git a/t/IsAwesome/Sloff.t b/t/IsAwesome/Sloff.t new file mode 100644 index 000000000..4f5720eb7 --- /dev/null +++ b/t/IsAwesome/Sloff.t @@ -0,0 +1,17 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "is_awesome_sloff"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( DDG::Goodie::IsAwesome::Sloff )], + 'duckduckhack sloff' => test_zci('Ettienne Pitts is awesome and has successfully completed the DuckDuckHack Goodie tutorial!'), + 'duckduckhack sloff is awesome' => undef, +); + +done_testing;