Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add some tests and update deps

  • Loading branch information...
commit b455571f1feee8af1f65baad8603b085ef8fbcb9 1 parent 4a025d9
@franckcuny franckcuny authored
Showing with 36 additions and 4 deletions.
  1. +5 −4 Makefile.PL
  2. +31 −0 t/basic.t
View
9 Makefile.PL
@@ -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;
View
31 t/basic.t
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.