Sha256: 2123e1765409a0c2346022911e4fba8807dc0807cc92cea032fbb368bf2fb927

Contents?: true

Size: 1.08 KB

Versions: 15

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe "Sphinx Keywords", :live => true do
  before :each do
    @client = Riddle::Client.new("localhost", 9313)
  end
  
  it "should return an array of hashes" do
    results = @client.keywords("pat", "people")
    results.should be_kind_of(Array)
    
    results.each do |result|
      result.should be_kind_of(Hash)
    end
  end
  
  it "should have keys for normalised and tokenised versions of the keywords" do
    results = @client.keywords("pat", "people")
    results.each do |result|
      result.keys.should include(:normalised)
      result.keys.should include(:tokenised)
    end
  end
  
  it "shouldn't have docs or hits keys if not requested" do
    results = @client.keywords("pat", "people")
    results.each do |result|
      result.keys.should_not include(:docs)
      result.keys.should_not include(:hits)
    end
  end
  
  it "should have docs and hits keys if requested" do
    results = @client.keywords("pat", "people", true)
    results.each do |result|
      result.keys.should include(:docs)
      result.keys.should include(:hits)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
riddle-2.1.0 spec/functional/keywords_spec.rb
riddle-2.0.0 spec/functional/keywords_spec.rb
riddle-1.5.12 spec/functional/keywords_spec.rb
riddle-1.5.11 spec/functional/keywords_spec.rb
riddle-1.5.10 spec/functional/keywords_spec.rb
riddle-1.5.9 spec/functional/keywords_spec.rb
riddle-1.5.8 spec/functional/keywords_spec.rb
riddle-1.5.7 spec/functional/keywords_spec.rb
riddle-1.5.6 spec/functional/keywords_spec.rb
riddle-1.5.5 spec/functional/keywords_spec.rb
riddle-1.5.4 spec/functional/keywords_spec.rb
riddle-1.5.3 spec/functional/keywords_spec.rb
riddle-1.5.2 spec/functional/keywords_spec.rb
riddle-1.5.1 spec/functional/keywords_spec.rb
riddle-1.5.0 spec/functional/keywords_spec.rb