diff options
| author | franck cuny <franck@lumberjaph.net> | 2009-12-11 17:17:09 +0100 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2009-12-11 17:17:09 +0100 |
| commit | b455571f1feee8af1f65baad8603b085ef8fbcb9 (patch) | |
| tree | b94277167cbddcbe3984dae9a0935b587a96d70f /t | |
| parent | requires methods to do simple tasks (diff) | |
| download | anyevent-riak-b455571f1feee8af1f65baad8603b085ef8fbcb9.tar.gz | |
add some tests and update deps
Diffstat (limited to 't')
| -rw-r--r-- | t/basic.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/basic.t b/t/basic.t new file mode 100644 index 0000000..29fed23 --- /dev/null +++ b/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(); |
