Skip to content

Commit

Permalink
added pereklyuchatel STORAGE=file|mem for running specs [#59 state:re…
Browse files Browse the repository at this point in the history
…solved]
  • Loading branch information
Oleg Andreev committed May 22, 2008
1 parent de2d95d commit 72805eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/spec_helper.rb
Expand Up @@ -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
Expand Down

2 comments on commit 72805eb

@michaelklishin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pereklyuchatel :D

@yrashk
Copy link
Owner

@yrashk yrashk commented on 72805eb May 22, 2008

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oleg’s type of jokes

Please sign in to comment.