view release on metacpan or search on metacpan
t/01_crud.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo" });
isa_ok $couch => "DBIx::CouchLike";
ok $couch->can('dbh');
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
my $trace;
if ($ENV{TRACE}) {
require IO::Scalar;
t/02_view.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $a_id = $couch->post( 1 => { tags => ['dog', 'cat'], name => 'animal' });
my $u_id = $couch->post( 2 => { tags => ['cat', 'more', 'less'], name => 'unix command' });
t/03_view_obj.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view2" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $a_id = $couch->post( 1 => { tags => ['dog', 'cat'], name => 'animal' });
my $u_id = $couch->post( 2 => { tags => ['cat', 'more', 'less'], name => 'unix command' });
t/05_reduce.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
use Data::Dumper;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
ok $couch->post( { tags => ['dog', 'cat'], name => 'animal' });
ok $couch->post( { tags => ['cat', 'less', 'more'], name => 'unix command' });
t/06_utf8.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
use Encode;
use utf8;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo" });
ok $couch->create_table;
my $id = $couch->post({ text => 'UTF-8æååãå
¥ãã¾ã' });
my $obj = $couch->get($id);
is $obj->{text} => 'UTF-8æååãå
¥ãã¾ã';
ok utf8::is_utf8($obj->{text});
$dbh->commit unless $ENV{DSN};
t/07_no_utf8.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
use Encode;
use Data::Dumper;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo", utf8 => 0 });
ok $couch->create_table;
is $couch->utf8 => 0;
my $text = 'UTF-8æååãå
¥ãã¾ã';
ok !utf8::is_utf8($text);
my $id = $couch->post({ text => $text });
t/08_view_itr.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $a_id = $couch->post( 1 => { tags => ['dog', 'cat'], name => 'animal' });
my $u_id = $couch->post( 2 => { tags => ['cat', 'more', 'less'], name => 'unix command' });
t/09_reduce.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
use Data::Dumper;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $id = $couch->post( { tags => ['cat'], name => 'animal' });
ok $couch->post("_design/tags" => {
t/10_combined.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
do_sql($dbh);
my $couch_p = DBIx::CouchLike->new({ dbh => $dbh, table => "page" });
my @v = $couch_p->view('all/list');
is_deeply( \@v => [
{ 'value' => '1', 'id' => '/', 'key' => '/' },
{ 'value' => '1', 'id' => '/foo.html', 'key' => '/foo.html' }
]);
t/11_combined.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
do_sql($dbh);
my $couch_p = DBIx::CouchLike->new({ dbh => $dbh, table => "page" });
my @v = $couch_p->view('all/list');
is_deeply( \@v => [
{ 'value' => '1', 'id' => '/default', 'key' => '/default' },
]);
my $p = $couch_p->get('/default');
t/12_reverse.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $a_id = $couch->post( 1 => { tags => ['dog', 'cat'], name => 'animal' });
my $u_id = $couch->post( 2 => { tags => ['cat', 'more', 'less'], name => 'unix command' });
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
$couch->post( 1 => { tags => ['dog', 'cat'], name => 'animal' });
$couch->post( 2 => { tags => ['cat', 'more', 'less'], name => 'unix command' });
t/14_crud_multi.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo" });
isa_ok $couch => "DBIx::CouchLike";
ok $couch->can('dbh');
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
is $couch->table => "foo";
ok $couch->create_table;
t/15_view_multi.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $func = q|
sub {
t/16_view_with.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "view" });
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;
my $func = q|
sub {
t/17_trace.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More;
use Test::Requires qw/ DBD::SQLite IO::Scalar /;
BEGIN {
use_ok 'DBIx::CouchLike';
}
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo" });
isa_ok $couch => "DBIx::CouchLike";
$couch->create_table;
{
my $trace;
$couch->trace( IO::Scalar->new(\$trace) );
$couch->get("abcdefg");
t/21_versioning_crud.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo", versioning => 1 });
isa_ok $couch => "DBIx::CouchLike";
ok $couch->can('dbh');
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
my $trace;
if ($ENV{TRACE}) {
require IO::Scalar;
t/22_versioning_conflict.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More qw/ no_plan /;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({ dbh => $dbh, table => "foo", versioning => 1 });
isa_ok $couch => "DBIx::CouchLike";
ok $couch->can('dbh');
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->versioning;
is $couch->table => "foo";
t/23_versioning_view.t view on Meta::CPAN
# -*- mode:perl -*-
use strict;
use Test::More;
use Test::Requires qw/ DBD::SQLite /;
BEGIN { use_ok 'DBIx::CouchLike' }
my $dbh = require 't/connect.pl';
ok $dbh;
my $couch = DBIx::CouchLike->new({
dbh => $dbh, table => "view", versioning => 1,
});
isa_ok $couch => "DBIx::CouchLike";
is $couch->dbh => $dbh;
ok $couch->dbh->ping;
ok $couch->create_table;