Changeset 270

Show
Ignore:
Timestamp:
04/25/08 10:26:54 (7 months ago)
Author:
eric.dumin..@gmail.com
Message:

Occam's razor (part 2)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/picolena/templates/app/models/document.rb

    r269 r270  
    22class Document 
    33  attr_reader :complete_path 
    4   attr_accessor :user, :score, :matching_content 
     4  attr_accessor :score, :matching_content 
    55 
    66  def initialize(path) 
  • trunk/lib/picolena/templates/spec/models/document_spec.rb

    r263 r270  
    22 
    33basic_pdf_attribute={ 
    4   :size=>9380, 
    54  :dirname=>File.join(RAILS_ROOT, 'spec/test_dirs/indexed/basic'), 
    65  :basename=>'basic', 
     
    3433  } 
    3534 
    36   it "should know which user it belongs to, if specified" do 
    37     @valid_random_doc.should respond_to(:user) 
    38     @valid_random_doc.user.should be_nil 
    39     @valid_random_doc.user="eric" 
    40     @valid_random_doc.user.should == "eric" 
    41   end 
    42  
    4335  it "should know its content" do 
    4436    another_doc=Document.new("spec/test_dirs/indexed/basic/plain.txt") 
  • trunk/lib/picolena/templates/spec/models/finder_spec.rb

    r264 r270  
    7373    matching_document_for("filetype:xyz").basename.should == "ghjopdfg" 
    7474    matching_document_for("filetype:abc").filename.should == "asfg.abc" 
    75     matching_document_for("unreadable.png").size.should == 19696 
    76     #Support for xls has been added meanwhile. The test is still valid though. 
    77     matching_document_for("table.xls").size.should == 8704 
    7875  end 
    7976 
     
    9390  it "should find documents according to their utf8 content" do 
    9491    matching_document_for("Éric Mößer ext:pdf").basename.should == "utf8" 
    95     matching_document_for("no me hace daño").size.should == 30 
     92    matching_document_for("no me hace daño").filename.should == "utf8.txt" 
    9693    matching_document_for("Éric Mößer filetype:pdf").filename.should == "utf8.pdf" 
    9794  end