/[couchdb]/t/10-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 /t/10-couchdb.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (hide annotations)
Sat Aug 9 16:10:05 2008 UTC (15 years, 8 months ago) by dpavlin
File MIME type: application/x-troff
File size: 656 byte(s)
first cut at integration with couchdb which partially works
1 dpavlin 12 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     use Test::More tests => 16;
6     use lib 'lib';
7    
8     BEGIN {
9     use_ok('CouchDB::Estraier');
10     use_ok('CouchDB::Client');
11     }
12    
13     my $database = 'estraier-test';
14     my $uri = 'http://localhost:5984/';
15    
16     ok( my $c = CouchDB::Client->new(uri => $uri), "new $uri" );
17     ok( $c->testConnection, 'testConnection' );
18     ok( my $db = $c->newDB( $database ), "newDB $database" );
19     $db->delete if $c->dbExists( $database );
20     ok( $db->create, 'create' );
21    
22    
23     for my $i ( 1 .. 5 ) {
24    
25     my $_id = 'test-' . $i;
26    
27     ok( my $doc = $db->newDoc( $_id ), "newDoc $_id" );
28     $doc->{data} = {
29     foo => $i,
30     bar => "baz $i",
31     };
32    
33     ok( $doc->create, 'create' );
34    
35     }
36    
37    
38    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26