Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RObject#links is an Array, not a Set, if the object is returned by Bucket#get_or_new() #123

Merged
merged 2 commits into from
Sep 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/riak/client/beefcake/object_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def load_content(pbuf, rcontent)
rcontent.raw_data = pbuf.value
rcontent.etag = pbuf.vtag if pbuf.vtag.present?
rcontent.content_type = pbuf.content_type if pbuf.content_type.present?
rcontent.links = pbuf.links.map(&method(:decode_link)) if pbuf.links.present?
rcontent.links = Set.new(pbuf.links.map(&method(:decode_link))) if pbuf.links.present?
pbuf.usermeta.each {|pair| decode_meta(pair, rcontent.meta) } if pbuf.usermeta.present?
if pbuf.indexes.present?
rcontent.indexes.clear
Expand Down
3 changes: 3 additions & 0 deletions spec/support/unified_backend_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
@robject.content_type = "application/json"
@robject.data = { "test" => "pass" }
@robject.indexes['test_bin'] << 'pass' if test_server.version >= "1.0.0"
@robject.links << Riak::Link.new('/riak/foo/bar', 'next')
@robject.links << Riak::Link.new('/riak/foo/baz', 'next')
@backend.store_object(@robject)
end

it "should find a stored object" do
robj = @backend.fetch_object("test", "fetch")
robj.should be_kind_of(Riak::RObject)
robj.data.should == { "test" => "pass" }
robj.links.should be_a Set
end

it "should raise an error when the object is not found" do
Expand Down