Permalink
Browse files

added expect tests for `duckpan query`

  • Loading branch information...
1 parent 7a1ff5e commit 64424955ba0166f9846b6ee11fae520aac945484 @majuscule majuscule committed Jan 29, 2013
Showing with 49 additions and 0 deletions.
  1. +26 −0 t/01-cmds.t
  2. +11 −0 t/test_dist/lib/DDG/Goodie/TwoShoes.pm
  3. +12 −0 t/test_dist/lib/DDG/Spice/NagaBhutJolokiaDax.pm
View
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More;
+use Test::Expect;
+
+expect_run(
+ command => "cd t/test_dist && ../../bin/duckpan query",
+ prompt => 'Query: ',
+ quit => '',
+);
+
+expect_run(
+ command => "cd t/test_dist && ../../bin/duckpan query Goodie::TwoShoes",
+ prompt => 'Query: ',
+ quit => '',
+);
+
+expect_run(
+ command => "cd t/test_dist && ../../bin/duckpan query Spice::NagaBhutJolokiaDax",
+ prompt => 'Query: ',
+ quit => '',
+);
+
+done_testing;
@@ -0,0 +1,11 @@
+package DDG::Goodie::TwoShoes;
+
+use DDG::Goodie;
+
+triggers start => //;
+
+handle remainder => sub {
+ return;
+};
+
+1;
@@ -0,0 +1,12 @@
+package DDG::Spice::NagaBhutJolokiaDax;
+
+use DDG::Spice;
+
+triggers start => //;
+spice to => //;
+
+handle remainder => sub {
+ return;
+};
+
+1;

0 comments on commit 6442495

Please sign in to comment.