Add more tests
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 10 Jan 2015 14:35:58 +0000 (16:35 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 10 Jan 2015 14:36:10 +0000 (16:36 +0200)
t/Zeal.t
t/ds/b.docset/Contents/Resources/docSet.dsidx

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%');
index 267ae67ad439d38f3a449e06041bf5ca5a1b67df..93ac1816e8385502f1c0d5f56534b04b5e82bbd9 100644 (file)
Binary files a/t/ds/b.docset/Contents/Resources/docSet.dsidx and b/t/ds/b.docset/Contents/Resources/docSet.dsidx differ
This page took 0.011646 seconds and 4 git commands to generate.