Sha256: 56007997da8e150505b1a3dd71ea603856767048d0585752094b2ed594746d74
Contents?: true
Size: 970 Bytes
Versions: 1
Compression:
Stored size: 970 Bytes
Contents
module CrdtSearchFixtures def map_result_score 43.21 end def maps_type_name Riak::Crdt::DEFAULT_BUCKET_TYPES[:map] end def maps_bucket_type return @maps_bucket_type if defined? @maps_bucket_type @maps_bucket_type = instance_double('Riak::BucketType').tap do |bt| allow(bt).to receive(:bucket). with(bucket_name). and_return(map_bucket) allow(bt).to receive(:data_type_class). and_return(Riak::Crdt::Map) end end def map_bucket @map_bucket ||= instance_double('Riak::BucketTyped::Bucket') end def map_raw @map_raw ||= { 'score'=>map_result_score, '_yz_rb'=>bucket_name, '_yz_rt'=>maps_type_name, '_yz_rk'=>'map-key' } end def map_results @map_results ||= Riak::Search::ResultDocument.new client, map_raw end end RSpec.configure do |config| config.include CrdtSearchFixtures, crdt_search_fixtures: true end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
riak-client-2.5.0 | spec/support/crdt_search_fixtures.rb |