Sha256: 9107b83ee32d59c905cff3ceeae5e7e8484fff2671184156f360042fe4b37195

Contents?: true

Size: 938 Bytes

Versions: 10

Compression:

Stored size: 938 Bytes

Contents

module CrdtSearchFixtures
  def map_result_score
    43.21
  end

  def maps_type_name
    'maps'
  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

10 entries across 10 versions & 2 rubygems

Version Path
riak-client-2.4.1 spec/support/crdt_search_fixtures.rb
riak-client-2.4.0 spec/support/crdt_search_fixtures.rb
riak-client-2.4.0.pre1 spec/support/crdt_search_fixtures.rb
riak-client-2.3.2 spec/support/crdt_search_fixtures.rb
riak-client-2.3.1 spec/support/crdt_search_fixtures.rb
riak-client-2.3.0 spec/support/crdt_search_fixtures.rb
riak-client-2.2.2 spec/support/crdt_search_fixtures.rb
riak-client-2.2.1 spec/support/crdt_search_fixtures.rb
riak-client-noenc-1.0.0 spec/support/crdt_search_fixtures.rb
riak-client-2.2.0 spec/support/crdt_search_fixtures.rb