Sha256: 6101931b848fdd8b5aca24056ca8f38dec520239c95b5c93afd202d41077fc1e

Contents?: true

Size: 950 Bytes

Versions: 3

Compression:

Stored size: 950 Bytes

Contents

require 'spec_helper'

describe "Protocol Buffers", test_client: true do
  before do
    @client = test_client
    @bucket = random_bucket 'protobuf_spec'
  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 yokozuna" do
          include_context "search corpus setup"

          it 'should return documents with UTF-8 fields (GH #75)' do
            utf8 = Encoding.find('UTF-8')
            results = @backend.search @search_bucket.name, 'fearless elephant rushed', df: 'text'
            results['docs'].each do |d|
              d.each {|(k,v)| expect(k.encoding).to eq(utf8); expect(v.encoding).to eq(utf8) }
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
riak-client-2.0.0 spec/integration/riak/protobuffs_backends_spec.rb
riak-client-2.0.0.rc2 spec/integration/riak/protobuffs_backends_spec.rb
riak-client-2.0.0.rc1 spec/integration/riak/protobuffs_backends_spec.rb