summary refs log tree commit diff
path: root/t
diff options
context:
space:
mode:
authorMainframe2008 <thg.bot@gmail.com>2013-02-26 08:44:28 +0100
committerMainframe2008 <thg.bot@gmail.com>2013-02-26 08:44:28 +0100
commit1b442767f0bc92b98c3a398dde02dae6212ecd1c (patch)
tree103131ad787226886342fa39d44317ce9438c5e1 /t
parentAdd documentation for secondary indexes (diff)
downloadnet-riak-1b442767f0bc92b98c3a398dde02dae6212ecd1c.tar.gz
*Added secondary index support using method names from the riak python
client.
* Added tests for secondary indexes
* Added documentation
Diffstat (limited to 't')
-rw-r--r--t/25-2index.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/25-2index.t b/t/25-2index.t
new file mode 100644
index 0000000..c6d420c
--- /dev/null
+++ b/t/25-2index.t
@@ -0,0 +1,17 @@
+use lib 't/lib';
+use Test::More;
+use Test::Riak;
+
+test_riak_rest {
+	my ($client, $bucket_name) = @_;
+	my $content = { field => "2index" };
+	ok my $bucket = $client->bucket($bucket_name), 'got bucket test';
+	ok my $obj = $bucket->new_object('2ikey', $content), 
+		'created a new riak object for seconday index';
+	ok $obj->add_index('myindex_bin', 'value'), 'Secondary index created';
+	
+	ok $obj->store, 'Object with secondary index stored';
+	ok my $newobj->get('2ikey'), 'Object with secondary index retrieved';
+	ok $newobj->remove_index('myindex_bin', 'value'), 'Secondary index removed';
+	ok $newobj->store, "Object without secondary index saved";
+}
\ No newline at end of file