/[webpac2]/trunk/t/5-output-couchdb.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/5-output-couchdb.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1196 - (hide annotations)
Wed May 27 22:17:00 2009 UTC (14 years, 11 months ago) by dpavlin
File MIME type: application/x-troff
File size: 842 byte(s)
 r1880@llin:  dpavlin | 2009-05-27 23:45:18 +0200
 added output to CouchDB

1 dpavlin 1196 #!/usr/bin/perl -w
2    
3     use strict;
4     use blib;
5    
6     use Test::More tests => 9;
7    
8     BEGIN {
9     use lib 'lib';
10     use_ok( 'WebPAC::Test' );
11     use_ok( 'WebPAC::Output::CouchDB' );
12     use_ok( 'SWISH::API' );
13     }
14    
15     my $path = "$abs_path/kino/";
16    
17     ok(my $out = new WebPAC::Output::CouchDB({
18     database => 'webpac2',
19     %LOG
20     }), "new");
21    
22     ok( $out->init, 'init' );
23    
24     my $ds = {
25     'Source' => {
26     'name' => 'Izvor: ',
27     'search' => [ 'tko zna' ]
28     },
29     'ID' => {
30     'search' => [ 'id' ],
31     },
32     'Array' => {
33     'search' => [ qw/a1 a2 s3 a4 a5/ ],
34     },
35     'foo' => {
36     'search' => [ 'foo' ],
37     },
38     };
39    
40     ok( $out->add( 42, $ds ), 'add 42' );
41    
42     my @strange = ( qw/èajðinica odma¹æivanje ¾abokreèina ¹uma/ );
43    
44     ok( $out->add( 99, { foo => { search => [ @strange ] } } ), 'add 99' );
45    
46     ok( $out->add( 100, { foo => { search => [ qw/foo bar baz/ ] } } ), 'add 100' );
47    
48     ok( $out->finish, 'finish' );
49    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26