Sha256: 0143a4f96979079afc1b88f10cb169feef0183ab711c6896bcebd62b377f359d

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "Host indexing system" do
 PlainText.filter_dependencies.each do |dependency|
    it "should have #{dependency} installed" do
       IO.popen("which #{dependency}"){|i| i.read.should_not be_empty}
    end
  end
  
  it "should know which IP addresses are allowed (config/custom/white_list_ip.yml)" do
    File.should be_readable('config/custom/white_list_ip.yml')
  end
  
  it "should know which directories are to be indexed (config/custom/indexed_directories.yml)" do
    File.should be_readable('config/custom/indexed_directories.yml')
  end
  
  it "should be able to calculate base26 hash from strings" do
    "test_dirs/indexed/010/decrepito.pdf".base26_hash(5).should == "rails"
    "test_dirs/indexed/migrations/000_restreins.rb".base26_hash(5).should == "ricou"
    # it would probably take ages to find a string whose hash == "picolena" :(
    "test_dirs/indexed/1148/plots.odt".base26_hash(8).should == "picolehn"
    "whatever.pdf".base26_hash(10).should == "bbuxhynait"
  end
  
  it "should not use too small a hash for Document#probably_unique_id" do
    HashLength.should_not < 10
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
picolena-0.1.1 lib/picolena/templates/spec/models/host_indexing_system_spec.rb