Add more tests
[zeal.git] / t / Zeal.t
index 5bbf7a5c5c25ccb17aa225f2347b9d74442d5f14..abe7f4669559f2573fa27d91b298fb95c3ce210c 100644 (file)
--- a/t/Zeal.t
+++ b/t/Zeal.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 18;
+use Test::More tests => 20;
 BEGIN { use_ok('Zeal') };
 
 note 'Working with t/ds/b.docset';
@@ -17,6 +17,7 @@ my $doc = $ds->query('building');
 is $doc->name, 'building', 'document name is building';
 is $doc->type, 'Word', 'document type is Word';
 like $doc->fetch, qr/^Dummy/, 'document HTML starts with "Dummy"';
+is $doc->anchor, 'dummy_anchor', 'document anchor is dummy_anchor';
 
 @results = sort {$a->name cmp $b->name} $ds->list;
 is @results, 2, 'docset contains two documents';
@@ -24,6 +25,12 @@ is $results[0]->name, 'building', 'first result is "building"';
 
 note 'Working with all docsets in t/ds/';
 my $zeal = Zeal->new('t/ds/');
+eval {
+       $zeal->query('family:term');
+       fail 'An exception was not thrown when searching for a nonexistent family';
+       1
+} or like $@, qr/^No docsets/, 'An exception is thrown when searching for a nonexistent family';
+
 my @sets = $zeal->sets;
 is @sets, 3, '3 docsets loaded';
 @results = $zeal->query('buil%');
This page took 0.00937 seconds and 4 git commands to generate.