Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed setup_index spec helper

  • Loading branch information...
commit 962b10f4784610cbdbd6e408ec98b7a84051fa16 1 parent 518bb24
Oleg Andreev authored
View
3  lib/strokedb/store.rb
@@ -4,13 +4,12 @@ module StrokeDB
class Store
include Enumerable
- attr_accessor :storage, :index_store, :uuid
+ attr_accessor :storage, :uuid
attr_reader :timestamp
def initialize(options = {})
@options = options.stringify_keys
@storage = @options['storage']
- @index_store = @options['index']
initialize_files
autosync! unless @options['noautosync']
raise "Missing chunk storage" unless @storage
View
10 spec/lib/strokedb/document/associations_spec.rb
@@ -4,7 +4,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Playlist = Meta.new do
@@ -173,7 +172,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Playlist = Meta.new do
@@ -195,7 +193,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Playlist = Meta.new do
@@ -218,7 +215,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Namespace') if defined?(Namespace)
Namespace = Module.new
Namespace.nsurl 'namespace'
@@ -243,7 +239,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Playlist = Meta.new do
@@ -265,7 +260,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Playlist = Meta.new do
@@ -286,7 +280,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
@@ -308,7 +301,6 @@
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
@@ -335,7 +327,6 @@
describe "Playlist.has_many :songs, :extend => MyExt association" do
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Object.send!(:remove_const,'MyExt') if defined?(MyExt)
@@ -357,7 +348,6 @@
describe "Playlist.has_many :songs do .. end association" do
before(:each) do
setup_default_store
- setup_index
Object.send!(:remove_const,'Playlist') if defined?(Playlist)
Object.send!(:remove_const,'Song') if defined?(Song)
Playlist = Meta.new do
View
10 spec/lib/strokedb/document/callbacks_spec.rb
@@ -2,7 +2,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new do
@@ -37,7 +37,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new do
on_load do |obj|
@@ -64,7 +64,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new do
@@ -86,7 +86,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new do
@@ -109,7 +109,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new do
View
2  spec/lib/strokedb/document/coercions_spec.rb
@@ -2,7 +2,7 @@
def setup
setup_default_store
- setup_index
+
Object.send!(:remove_const, 'Foo') if defined?(Foo)
Object.send!(:remove_const, 'Bar') if defined?(Bar)
Object.send!(:remove_const, 'User') if defined?(User)
View
6 spec/lib/strokedb/document/document_spec.rb
@@ -4,7 +4,7 @@
before(:each) do
@store = setup_default_store
- setup_index
+
end
it "should be able to find document by UUID" do
@@ -688,7 +688,7 @@ def slot1=(v)
before(:each) do
@store = setup_default_store
setup_default_store
- setup_index
+
Object.send!(:remove_const, "SomeMeta") if defined? ::SomeMeta
::SomeMeta = Meta.new(@store)
@meta = ::SomeMeta
@@ -714,7 +714,7 @@ def slot1=(v)
before(:each) do
@store = setup_default_store
- setup_index
+
@metas = []
3.times do |i|
@metas << Document.create!(:a => i, i => i, :name => i.to_s)
View
18 spec/lib/strokedb/document/meta_spec.rb
@@ -90,7 +90,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new
@@ -117,7 +117,7 @@
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
@some_meta = Meta.new(:nsurl => "http://some/")
@@ -135,7 +135,7 @@
before(:each) do
setup_default_store
- setup_index
+
@some_name = Meta.new(:name => 'SomeName') do
def some
end
@@ -161,7 +161,7 @@ def some
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
end
@@ -187,7 +187,7 @@ def some
before(:each) do
setup_default_store
- setup_index
+
module A
nsurl "some url"
end
@@ -214,7 +214,7 @@ module A
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'User') if defined?(User)
Object.send!(:remove_const,'Buyer') if defined?(Buyer)
@@ -259,7 +259,7 @@ module A
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new(:some_slot => 'some_value') do
@@ -312,7 +312,7 @@ def implements_some_name_meta
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new(:some_slot => 'some_value') do
@@ -376,7 +376,7 @@ def implements_some_name_meta
before(:each) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'SomeName') if defined?(SomeName)
SomeName = Meta.new
end
View
2  spec/lib/strokedb/document/validations_spec.rb
@@ -2,7 +2,7 @@
def validations_setup
setup_default_store
- setup_index
+
Object.send!(:remove_const, 'Foo') if defined?(Foo)
Object.send!(:remove_const, 'Bar') if defined?(Bar)
Object.send!(:remove_const, 'User') if defined?(User)
View
2  spec/lib/strokedb/document/virtualize_spec.rb
@@ -2,7 +2,7 @@
def setup
setup_default_store
- setup_index
+
Object.send!(:remove_const, 'Foo') if defined? Foo
Object.send!(:remove_const, 'Bar') if defined? Bar
end
View
2  spec/lib/strokedb/stores/store_spec.rb
@@ -68,7 +68,7 @@
before(:each) do
@store = setup_default_store
- setup_index
+
@documents = []
10.times do |i|
@documents << Document.create!(:stuff => i)
View
2  spec/regression/meta_spec.rb
@@ -4,7 +4,7 @@
before(:all) do
setup_default_store
- setup_index
+
Object.send!(:remove_const,'User') if defined?(User)
Object.send!(:remove_const,'Buyer') if defined?(Buyer)
User = StrokeDB::Meta.new
View
11 spec/spec_helper.rb
@@ -20,7 +20,7 @@ def setup_default_store(store=nil)
StrokeDB::MemoryStorage.new
end
- $store = StrokeDB::Store.new(:storage => @storage,:index => @index, :path => @path)
+ $store = StrokeDB::Store.new(:storage => @storage, :path => @path)
StrokeDB.stub!(:default_store).and_return($store)
StrokeDB.default_store
end
@@ -32,15 +32,6 @@ def stub_meta_in_store(store=nil)
store.should_receive(:include?).with(NIL_UUID).any_number_of_times.and_return(true)
end
-def setup_index(store=nil)
- store ||= StrokeDB.default_store
- index_storage = StrokeDB::InvertedListFileStorage.new(:path => TEMP_STORAGES + '/inverted_list_storage')
- index_storage.clear!
- @index = StrokeDB::InvertedListIndex.new(index_storage)
- @index.document_store = store
- store.index_store = @index
- @index
-end
Spec::Runner.configure do |config|
config.after(:all) do
Please sign in to comment.
Something went wrong with that request. Please try again.