Sha256: 9b1898918f8b2866f02d1ff20d6575d2c77f0a4804049f02c0a901969d466828

Contents?: true

Size: 1.03 KB

Versions: 11

Compression:

Stored size: 1.03 KB

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 'returns 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 do |(k, v)|
                expect(k.encoding).to eq(utf8)
                expect(v.encoding).to eq(utf8)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

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