forked from duckduckgo/zeroclickinfo-goodies
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue duckduckgo#1138 - start working
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package DDG::Goodie::PackageTracking; | ||
# 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 => 'package_tracking'; | ||
zci is_cached => 1; | ||
|
||
# Triggers | ||
triggers any => 'triggerWord', 'trigger phrase'; | ||
|
||
# Handle statement | ||
handle remainder => sub { | ||
# Query can be accessed in $_ | ||
|
||
return $_; | ||
}; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use DDG::Test::Goodie; | ||
|
||
zci answer_type => "package_tracking"; | ||
zci is_cached => 1; | ||
|
||
ddg_goodie_test( | ||
[qw( DDG::Goodie::PackageTracking )], | ||
# 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; |