Skip to content

Commit

Permalink
Issue duckduckgo#1138 - start working
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailkov committed Nov 21, 2015
1 parent 978b05b commit 63b442b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/DDG/Goodie/PackageTracking.pm
@@ -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;
22 changes: 22 additions & 0 deletions t/PackageTracking.t
@@ -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;

0 comments on commit 63b442b

Please sign in to comment.