Skip to content

Commit

Permalink
add some tests and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
fcuny committed Dec 11, 2009
1 parent 4a025d9 commit b455571
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ use inc::Module::Install;
name 'AnyEvent-Riak';
all_from 'lib/AnyEvent/Riak.pm';

# requires '';
requires 'Moose';
requires 'Test::Class';
requires 'Test::Exception';
requires 'URI';
requires 'JSON::XS';
requires 'AnyEvent';
requires 'AnyEvent::HTTP';

tests 't/*.t';
author_tests 'xt';

build_requires 'Test::More';
build_requires 'Test::Exception';
use_test_base;
auto_include;
WriteAll;
31 changes: 31 additions & 0 deletions t/basic.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use strict;
use warnings;
use Test::More;
use Test::Exception;
use AnyEvent::Riak;

my $jiak = AnyEvent::Riak->new(
host => 'http://127.0.0.1:8098',
path => 'jiak'
);

ok my $buckets = $jiak->list_bucket('bar')->recv, "... fetch bucket list";
is scalar @{ $buckets->{keys} }, '0', '... no keys';

ok my $new_bucket
= $jiak->set_bucket( 'foo', { allowed_fields => '*' } )->recv,
'... set a new bucket';

my $value = {
bucket => 'foo',
key => 'baz',
object => { foo => "bar" },
links => []
};

ok my $res = $jiak->store($value)->recv, '... set a new key';

ok $res = $jiak->fetch( 'foo', 'baz' )->recv, '... fetch our new key';
ok $res = $jiak->delete( 'foo', 'baz' )->recv, '... delete our key';

done_testing();

0 comments on commit b455571

Please sign in to comment.