spec/lib/application_spec.rb in picky-3.0.1 vs spec/lib/application_spec.rb in picky-3.1.0
- old
+ new
@@ -6,11 +6,11 @@
describe "integration" do
it "should run ok" do
lambda {
class MinimalTestApplication < described_class
- books = Picky::Indexes::Memory.new :books do
+ books = Picky::Index.new :books do
source Picky::Sources::DB.new(
'SELECT id, title FROM books',
:file => 'app/db.yml'
)
end
@@ -18,12 +18,12 @@
rack_adapter.stub! :exclaim # Stopping it from exclaiming.
route %r{^/books} => Picky::Search.new(books)
end
- Picky::Tokenizers::Index.default.tokenize 'some text'
- Picky::Tokenizers::Query.default.tokenize 'some text'
+ Picky::Tokenizer.index_default.tokenize 'some text'
+ Picky::Tokenizer.query_default.tokenize 'some text'
}.should_not raise_error
end
it "should run ok" do
lambda {
# Here we just test if the API can be called ok.
@@ -42,11 +42,11 @@
normalizes_words: [[/Deoxyribonucleic Acid/i, 'DNA']],
substitutes_characters_with: Picky::CharacterSubstituters::WestEuropean.new,
maximum_tokens: 5
- books_index = Picky::Indexes::Memory.new :books do
+ books_index = Picky::Index.new :books do
source Picky::Sources::DB.new(
'SELECT id, title, author, isbn13 as isbn FROM books',
:file => 'app/db.yml'
)
end
@@ -56,10 +56,10 @@
books_index.define_category :author,
similarity: Picky::Similarity::Soundex.new(2)
books_index.define_category :isbn,
partial: Picky::Partial::None.new # Partially searching on an ISBN makes not much sense.
- geo_index = Picky::Indexes::Memory.new :geo do
+ geo_index = Picky::Index.new :geo do
source Picky::Sources::CSV.new(:location, :north, :east, file: 'data/ch.csv', col_sep: ',')
indexing removes_characters: /[^a-z]/
category :location,
similarity: Picky::Similarity::Metaphone.new(4)
ranged_category :north1, 1, precision: 3, from: :north
\ No newline at end of file