Sha256: 8fd950ea9aba83b75daf48d97e984a7e8b2a1c72c1d1847bb263c5c1a186537b

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe "Protocol Buffers" do
  before do
    @pbc_port ||= test_server.pb_port
    @http_port ||= test_server.http_port
    @client = Riak::Client.new(:http_port => @http_port, :pb_port => @pbc_port, :protocol => "pbc")
  end

  [:BeefcakeProtobuffsBackend].each do |klass|
    bklass = Riak::Client.const_get(klass)
    if bklass.configured?
      describe klass.to_s do
        before do
          @backend = bklass.new(@client, @client.node)
        end

        it_should_behave_like "Unified backend API"

        describe "searching fulltext indexes (1.1 and earlier)", :version => '< 1.2.0' do
          include_context "search corpus setup"

          it 'should find document IDs via MapReduce' do
            # Note that the trailing options Hash is ignored when
            # emulating search with MapReduce
            results = @backend.search 'search_test', 'fearless elephant rushed'
            results.should have_key 'docs'
            results.should have_key 'max_score'
            results.should have_key 'num_found'
            results['docs'].should include({"id" => "munchausen-605"})
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
riak-client-1.1.1 spec/integration/riak/protobuffs_backends_spec.rb
riak-client-1.1.0 spec/integration/riak/protobuffs_backends_spec.rb