Sha256: 6bf5a84313d5d382e38aec3d14dea31683ebd31c430b604032b88e16bf642b6c

Contents?: true

Size: 444 Bytes

Versions: 3

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

module SphinxYamlHelpers
  def write_configuration(hash)
    allow(File).to receive(:read).and_return({'test' => hash}.to_yaml)
    allow(File).to receive(:exist?).and_wrap_original do |original, path|
      next true if path.to_s == File.absolute_path("config/thinking_sphinx.yml", Rails.root.to_s)

      original.call(path)
    end
  end
end

RSpec.configure do |config|
  config.include SphinxYamlHelpers
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 spec/support/sphinx_yaml_helpers.rb
thinking-sphinx-5.5.1 spec/support/sphinx_yaml_helpers.rb
thinking-sphinx-5.5.0 spec/support/sphinx_yaml_helpers.rb