Skip to content

Commit

Permalink
! application spec, loader spec
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Nov 8, 2010
1 parent 803a8bb commit d842939
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 6 additions & 9 deletions server/spec/lib/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
it "should run ok" do
lambda {
class MinimalTestApplication < Application
books = index :books,
Sources::DB.new('SELECT id, title FROM books', :file => 'app/db.yml'),
category(:title)
books = index :books, Sources::DB.new('SELECT id, title FROM books', :file => 'app/db.yml')
books.category :title


full = Query::Full.new books
Expand Down Expand Up @@ -42,12 +41,10 @@ class TestApplication < Application
substitutes_characters_with: CharacterSubstitution::European.new,
maximum_tokens: 5

books_index = index :books,
Sources::DB.new('SELECT id, title, author, isbn13 as isbn FROM books', :file => 'app/db.yml'),
category(:title, :similarity => Similarity::DoubleLevenshtone.new(3)), # Up to three similar title word indexed.
category(:author),
category(:isbn, :partial => Partial::None.new) # Partially searching on an ISBN makes not much sense.

books_index = index :books, Sources::DB.new('SELECT id, title, author, isbn13 as isbn FROM books', :file => 'app/db.yml')
books_index.category :title, similarity: Similarity::DoubleLevenshtone.new(3) # Up to three similar title word indexed.
books_index.category :author
books_index.category :isbn, partial: Partial::None.new # Partially searching on an ISBN makes not much sense.

full = Query::Full.new books_index
live = Query::Live.new books_index
Expand Down
2 changes: 0 additions & 2 deletions server/spec/lib/loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

before(:each) do
@loader_path = File.absolute_path("#{File.dirname(__FILE__)}/../../lib/picky/loader.rb")
Configuration.stub! :apply
Indexes.stub! :setup
end

describe 'load_application' do
Expand Down

0 comments on commit d842939

Please sign in to comment.