0
0
Fork 0
polecat/spec/index_writer/count_spec.rb

19 lines
435 B
Ruby

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "IndexWriter#count" do
before :all do
@path = prepare_index_dir
end
it "returns 0 on an empty writer" do
w = Polecat::IndexWriter.new @path
w.count.should == 0
end
it "returns the number of documents stored in the storage" do
w = Polecat::IndexWriter.new @path
w.add Spec::TestDocument.new
w.count.should == 1
end
end