Sha256: 629a2e87a693a8eb885291ce8ad171877c1af56695e40b484cf35aebf5495aa7

Contents?: true

Size: 554 Bytes

Versions: 4

Compression:

Stored size: 554 Bytes

Contents

# encoding: utf-8
#
require 'spec_helper'
require 'ostruct'

describe "Option symbol_keys" do

  let(:index) do
    Picky::Index.new(:results1) { symbol_keys true }
  end
  let(:try) do
    Picky::Search.new(index) { symbol_keys }
  end

  # Test the enumerator abilities.
  #
  it 'can enumerate through the allocations' do
    index.category :text

    thing = OpenStruct.new id: 1, text: "ohai"
    other = OpenStruct.new id: 2, text: "ohai kthxbye"

    index.add thing
    index.add other

    try.search("text:ohai").ids.should == [2, 1]
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
picky-4.25.3 spec/functional/symbol_keys_spec.rb
picky-4.25.2 spec/functional/symbol_keys_spec.rb
picky-4.25.1 spec/functional/symbol_keys_spec.rb
picky-4.25.0 spec/functional/symbol_keys_spec.rb