Sha256: 7462441baf583a50fd970d063a752ba87229c96a911dec67527fd97aa4aeb07f

Contents?: true

Size: 884 Bytes

Versions: 44

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'

describe Picky::Query::IndexesCheck do

  describe 'check_backend_types' do
    before(:each) do
      @redis  = stub :redis,  :backend => Picky::Backends::Redis.new
      @memory = stub :memory, :backend => Picky::Backends::Memory.new
    end
    it 'does not raise on the same type' do
      described_class.check_backend_types [@redis, @redis]
    end
    it 'raises on multiple types' do
      expect do
        described_class.check_backend_types [@redis, @memory]
      end.to raise_error(Picky::Query::DifferentTypesError)
    end
    it 'raises with the right message on multiple types' do
      expect do
        described_class.check_backend_types [@redis, @memory]
      end.to raise_error("Currently it isn't possible to mix Indexes with backends Picky::Backends::Redis and Picky::Backends::Memory in the same Search instance.")
    end
  end
  
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
picky-3.6.16 spec/lib/query/indexes_check_spec.rb
picky-3.6.15 spec/lib/query/indexes_check_spec.rb
picky-3.6.14 spec/lib/query/indexes_check_spec.rb
picky-3.6.13 spec/lib/query/indexes_check_spec.rb
picky-3.6.12 spec/lib/query/indexes_check_spec.rb
picky-3.6.11 spec/lib/query/indexes_check_spec.rb
picky-3.6.10 spec/lib/query/indexes_check_spec.rb
picky-3.6.9 spec/lib/query/indexes_check_spec.rb
picky-3.6.8 spec/lib/query/indexes_check_spec.rb
picky-3.6.7 spec/lib/query/indexes_check_spec.rb
picky-3.6.6 spec/lib/query/indexes_check_spec.rb
picky-3.6.4 spec/lib/query/indexes_check_spec.rb
picky-3.6.3 spec/lib/query/indexes_check_spec.rb
picky-3.6.2 spec/lib/query/indexes_check_spec.rb
picky-3.6.1 spec/lib/query/indexes_check_spec.rb
picky-3.6.0 spec/lib/query/indexes_check_spec.rb
picky-3.5.4 spec/lib/query/indexes_check_spec.rb
picky-3.5.3 spec/lib/query/indexes_check_spec.rb
picky-3.5.2 spec/lib/query/indexes_check_spec.rb
picky-3.5.1 spec/lib/query/indexes_check_spec.rb