Sha256: c15a890cb929e92a9e469817568d65db50d0a7fefd5a8c4fbb612ee2dc2acedd

Contents?: true

Size: 784 Bytes

Versions: 17

Compression:

Stored size: 784 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.describe ThinkingSphinx::Hooks::GuardPresence do
  let(:subject) do
    ThinkingSphinx::Hooks::GuardPresence.new configuration, stream
  end
  let(:configuration) { double "configuration", :indices_location => "/path" }
  let(:stream)        { double "stream", :puts => nil }

  describe "#call" do
    it "outputs nothing if no guard files exist" do
      allow(Dir).to receive(:[]).with('/path/ts-*.tmp').and_return([])

      expect(stream).not_to receive(:puts)

      subject.call
    end

    it "outputs a warning if a guard file exists" do
      allow(Dir).to receive(:[]).with('/path/ts-*.tmp').
        and_return(['/path/ts-foo.tmp'])

      expect(stream).to receive(:puts)

      subject.call
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.5.1 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.5.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.4.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.3.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.2.1 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.2.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.1.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-5.0.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.4.1 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.4.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.3.2 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.3.1 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.3.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.2.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.1.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb
thinking-sphinx-4.0.0 spec/thinking_sphinx/hooks/guard_presence_spec.rb