Top Level Namespace

Defined Under Namespace

Modules: ApplicationHelper, DocumentsHelper, Enumerable, Picolena, PlainTextExtractorDSL, Rails, RubiGen Classes: ApplicationController, Array, Document, DocumentsController, File, Finder, Indexer, MimeType, PlainTextExtractor, Query, String

Constant Summary collapse

RAILS_ROOT =

Don’t change this file! Configure your app in config/environment.rb and config/environments/*.rb

"#{File.dirname(__FILE__)}/.."
IndexerLogger =
Logger.new($stdout)

Instance Method Summary collapse

Instance Method Details

#matching_document_for(query) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/picolena/templates/spec/models/finder_spec.rb', line 10

def matching_document_for(query)
  # Returns matching document for any given query only if
  # exactly one document is found.
  # Specs don't pass otherwise.
  matching_documents=Finder.new(query).matching_documents
  matching_documents.size.should == 1
  matching_documents.first
end

#revert_changes!(file, content) ⇒ Object



3
4
5
6
7
# File 'lib/picolena/templates/spec/models/finder_spec.rb', line 3

def revert_changes!(file,content)
  File.open(file,'w'){|might_have_been_modified|
    might_have_been_modified.write content
  }
end