summary refs log tree commit diff
path: root/t/03_delete_object.t
blob: f2d6d104a389558e469b87edbc214dd3e3388582 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use lib 't/lib';
use Test::More;
use Test::Riak;
use Data::Dumper;

test_riak {
    my ($client, $bucket_name) = @_;

    my $bucket  = $client->bucket($bucket_name);
    my $content = [int(rand(100))];
    my $obj     = $bucket->new_object('foo', $content);
    ok $obj->store, 'object is stored';
    $obj = $bucket->get('foo');
    ok $obj->exists, 'object exists';
    $obj->delete;
    ok $obj->exists, " exists after delete";
    $obj->load;
    ok !$obj->exists, "object don't exists after load";
    is scalar(@{$bucket->get_keys}), 0, "no keys left in bucket"; 
};