Sha256: fdf018cb6e680923f49bc5b6b7523c668b6b5a1255c69c6da7697872c096cbf9

Contents?: true

Size: 724 Bytes

Versions: 61

Compression:

Stored size: 724 Bytes

Contents

# encoding: utf-8
#
require 'spec_helper'

describe 'qualifier remapping' do

  it 'can have new qualifiers' do
    index = Picky::Index.new :qualifier_remapping do
      category :a
    end

    QualifierRemappingThing = Struct.new(:id, :a, :b)
    
    index.add QualifierRemappingThing.new(1, "a", "b")
    
    try = Picky::Search.new index
    
    # Picky finds nothing.
    #
    try.search('b').ids.should == []
    
    # Add a new category and a thing.
    #
    index.category :b
    index.add QualifierRemappingThing.new(2, "c", "b")
    
    # It finds it.
    #
    try.search('b').ids.should == [2]
    
    # It already also finds it with a qualifier!
    #
    try.search('b:b').ids.should == [2]
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
picky-4.31.3 spec/functional/remap_qualifiers_spec.rb
picky-4.31.2 spec/functional/remap_qualifiers_spec.rb
picky-4.31.1 spec/functional/remap_qualifiers_spec.rb
picky-4.31.0 spec/functional/remap_qualifiers_spec.rb
picky-4.30.0 spec/functional/remap_qualifiers_spec.rb
picky-4.29.0 spec/functional/remap_qualifiers_spec.rb
picky-4.28.1 spec/functional/remap_qualifiers_spec.rb
picky-4.27.1 spec/functional/remap_qualifiers_spec.rb
picky-4.27.0 spec/functional/remap_qualifiers_spec.rb
picky-4.26.2 spec/functional/remap_qualifiers_spec.rb
picky-4.26.1 spec/functional/remap_qualifiers_spec.rb
picky-4.26.0 spec/functional/remap_qualifiers_spec.rb
picky-4.25.3 spec/functional/remap_qualifiers_spec.rb
picky-4.25.2 spec/functional/remap_qualifiers_spec.rb
picky-4.25.1 spec/functional/remap_qualifiers_spec.rb
picky-4.25.0 spec/functional/remap_qualifiers_spec.rb
picky-4.24.0 spec/functional/remap_qualifiers_spec.rb
picky-4.23.2 spec/functional/remap_qualifiers_spec.rb
picky-4.23.1 spec/functional/remap_qualifiers_spec.rb
picky-4.23.0 spec/functional/remap_qualifiers_spec.rb