From 1f9817960af447d36cdd47501758b14565a8120b Mon Sep 17 00:00:00 2001 From: Gibheer Date: Thu, 26 May 2011 21:41:42 +0200 Subject: [PATCH] added a new spec for IndexWriter#write --- spec/index_writer/write_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/index_writer/write_spec.rb b/spec/index_writer/write_spec.rb index dbf151f..d8c393e 100644 --- a/spec/index_writer/write_spec.rb +++ b/spec/index_writer/write_spec.rb @@ -25,6 +25,14 @@ describe "IndexWriter#write" do File.exists?(@path + '/index.lock').should == false end + it "takes a higher number for the index file, if there is already one" do + FileUtils.touch @path + '/ind0.ind' + w = Polecat::IndexWriter.new @path + w.add Spec::FooDocument.new + w.write + File.exists?(@path + '/ind1.ind').should == true + end + it "writes a marshalled representation of the document list" do w = Polecat::IndexWriter.new @path doc = Spec::FooDocument.new