Sha256: dd266c5ba06d42aa6cc63c31a4a12f042ae9588c45f554d6cbdee3de6fac4ae4

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

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

describe "Hint: no_dump" do

  Book = Struct.new(:id, :title, :author)

  let(:index) do
    Picky::Index.new :no_dump do
      optimize :no_dump
      
      category :title
      category :author
    end
  end
  let(:try) { Picky::Search.new index }

  it 'can index and search' do
    index.replace Book.new(2, "Title", "Author")

    try.search("title:title").ids.should == [2]
  end
  
  context 'dumping and loading' do
    it "raises" do
      index.replace Book.new(2, "Title New", "Author New")

      expect {
        index.dump
        index.load
        index.build_realtime_mapping
      }.to raise_error # TODO Clarify error.
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
picky-4.27.1 spec/functional/no_dump_hint_spec.rb