Sha256: 963b46d3fcfc2af06f07356cad44c28f344e7470f8c5e6caa86a0ab55d140e08

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true
require 'spec_helper'
require 'drillbit/resource/processors/indexing'

module Drillbit
class  TestIndexClass
  def for_query(_param)
  end
end
end

module    Drillbit
module    Resource
module    Processors
describe  Indexing do
  let(:indexing_resource) { double }

  it 'does not do anything if indexing params are not passed in' do
    indexing = Indexing.new(indexing_resource)

    expect(indexing.processed).to eql indexing_resource
  end

  it 'does not do anything if indexing params are passed in but they are blank' do
    indexing = Indexing.new(indexing_resource,
                            'filter' => {
                              'query' => '',
                            })

    expect(indexing.processed).to eql indexing_resource
  end

  it 'forces a query even if no parameters were passed in' do
    indexing_resource = TestIndexClass.new
    indexing          = Indexing.new(indexing_resource)

    allow(indexing_resource).to receive(:for_query).
    with('*').
    and_return('blah')

    expect(indexing.processed).to eql 'blah'
  end
end
end
end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
drillbit-2.9.1 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.9.0 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.8.0 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.7.0 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.6.0 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.5.0 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.4.0 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.3.1 spec/drillbit/resource/processors/indexing_spec.rb
drillbit-2.3.0 spec/drillbit/resource/processors/indexing_spec.rb