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