/[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 1197 - (hide annotations)
Thu May 28 09:58:18 2009 UTC (14 years, 11 months ago) by dpavlin
File MIME type: application/x-troff
File size: 880 byte(s)
WebPAC::Output::CouchDB now takes uri to CouchDB server,
document ids now include input name

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 dpavlin 1197 url => 'http://193.198.212.57:5984',
19 dpavlin 1196 database => 'webpac2',
20     %LOG
21     }), "new");
22    
23     ok( $out->init, 'init' );
24    
25     my $ds = {
26     'Source' => {
27     'name' => 'Izvor: ',
28     'search' => [ 'tko zna' ]
29     },
30     'ID' => {
31     'search' => [ 'id' ],
32     },
33     'Array' => {
34     'search' => [ qw/a1 a2 s3 a4 a5/ ],
35     },
36     'foo' => {
37     'search' => [ 'foo' ],
38     },
39     };
40    
41     ok( $out->add( 42, $ds ), 'add 42' );
42    
43     my @strange = ( qw/èajðinica odma¹æivanje ¾abokreèina ¹uma/ );
44    
45     ok( $out->add( 99, { foo => { search => [ @strange ] } } ), 'add 99' );
46    
47     ok( $out->add( 100, { foo => { search => [ qw/foo bar baz/ ] } } ), 'add 100' );
48    
49     ok( $out->finish, 'finish' );
50    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26