From 72805eb5a6029a85d532c2c4d34f0e0c8139b4b8 Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Fri, 23 May 2008 00:47:49 +0400 Subject: [PATCH] added pereklyuchatel STORAGE=file|mem for running specs [#59 state:resolved] --- spec/spec_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 61f3f4e4..b7fca2e2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,10 +11,16 @@ def setup_default_store(store=nil) StrokeDB.stub!(:default_store).and_return(store) return store end - @mem_storage = StrokeDB::MemoryStorage.new @path = TEMP_STORAGES FileUtils.rm_rf @path - StrokeDB.stub!(:default_store).and_return(StrokeDB::Store.new(:storage => @mem_storage,:index => @index, + + @storage = if ENV['STORAGE'].to_s.downcase == 'file' + StrokeDB::FileStorage.new(:path => @path + '/file_storage') + else + StrokeDB::MemoryStorage.new + end + + StrokeDB.stub!(:default_store).and_return(StrokeDB::Store.new(:storage => @storage,:index => @index, :path => @path)) StrokeDB.default_store end