Sha256: 70c9cd3e06b9ae902db563a6505c763a6b956127e9b32db69f097ff63036e4f2

Contents?: true

Size: 780 Bytes

Versions: 14

Compression:

Stored size: 780 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ThinkingSphinx::Commands::Prepare do
  let(:command)       { ThinkingSphinx::Commands::Prepare.new(
    configuration, {}, stream
  ) }
  let(:configuration) { double 'configuration',
    :indices_location => '/path/to/indices', :settings => {}
  }
  let(:stream)        { double :puts => nil }

  before :each do
    allow(FileUtils).to receive_messages :mkdir_p => true
  end

  it "creates the directory for the index files" do
    expect(FileUtils).to receive(:mkdir_p).with('/path/to/indices')

    command.call
  end

  it "skips directory creation if flag is set" do
    configuration.settings['skip_directory_creation'] = true

    expect(FileUtils).to_not receive(:mkdir_p)

    command.call
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.5.1 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.5.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.4.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.3.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.2.1 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.2.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.1.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-5.0.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-4.4.1 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-4.4.0 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-4.3.2 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-4.3.1 spec/thinking_sphinx/commands/prepare_spec.rb
thinking-sphinx-4.3.0 spec/thinking_sphinx/commands/prepare_spec.rb