diff options
| author | Robin Edwards <robin.ge@gmail.com> | 2011-04-20 14:38:43 +0100 |
|---|---|---|
| committer | Robin Edwards <robin.ge@gmail.com> | 2011-04-20 14:38:43 +0100 |
| commit | 79bea382fd2c0753ca9ace79a11bb74c9a1d722b (patch) | |
| tree | bde42a47792a27e0a863ee527b88c8c24258f7e9 /t/01_store_fetch_object.t | |
| parent | Merge remote branch 'simon/fix_link_encoding' (diff) | |
| download | net-riak-79bea382fd2c0753ca9ace79a11bb74c9a1d722b.tar.gz | |
merged pbc branch to master
Diffstat (limited to 't/01_store_fetch_object.t')
| -rw-r--r-- | t/01_store_fetch_object.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/01_store_fetch_object.t b/t/01_store_fetch_object.t new file mode 100644 index 0000000..09f5e99 --- /dev/null +++ b/t/01_store_fetch_object.t @@ -0,0 +1,25 @@ +use lib 't/lib'; +use Test::More; +use Test::Riak; + +test_riak { + my ($client, $bucket_name) = @_; + ok my $bucket = $client->bucket($bucket_name), 'got bucket test'; + my $content = [int(rand(100))]; + ok my $obj = $bucket->new_object('foo', $content), + 'created a new riak object'; + + ok $obj->store, 'store object foo'; + + if ($obj->client->can('status')) { + is $obj->client->status, 200, 'valid status'; + } + + is $obj->key, 'foo', 'valid key'; + is_deeply $obj->data, $content, 'valid content'; + + ok $obj = $bucket->new_object(undef, $content), + 'created a new riak object without a key'; + ok $obj->store, 'store object without key'; + ok $obj->key, 'key created'; +}; |
