spec/functional/backends/sqlite_spec.rb in picky-3.6.8 vs spec/functional/backends/sqlite_spec.rb in picky-3.6.9

- old
+ new

@@ -48,10 +48,20 @@ data.remove 1 books.search('title').ids.should == [2] end + it 'handles removing with three entries' do + data.add Book.new(2, 'title', 'author') + data.add Book.new(3, 'title', 'author') + + books.search('title').ids.should == [3, 2, 1] + + data.remove 1 + + books.search('title').ids.should == [3, 2] + end it 'handles clearing' do data.clear books.search('title').ids.should == [] end @@ -59,20 +69,10 @@ data.dump data.load books.search('title').ids.should == [1] end - it 'handles removing with three entries' do - data.add Book.new(2, 'title', 'author') - data.add Book.new(3, 'title', 'author') - - books.search('title').ids.should == [3, 2, 1] - - data.remove 1 - - books.search('title').ids.should == [3, 2] - end it 'handles replacing' do data.replace Book.new(1, 'toitle', 'oithor') books.search('title').ids.should == [] books.search('toitle').ids.should == [1] @@ -88,17 +88,17 @@ end instance_eval &its end - # context 'immediately indexing backend (no dump needed)' do - # before(:each) do - # data.backend described_class.new(self_indexed: true) - # data.clear - # - # data.add Book.new(1, 'title', 'author') - # end - # - # instance_eval &its - # end + context 'immediately indexing backend (no dump needed)' do + before(:each) do + data.backend described_class.new(self_indexed: true) + data.clear + + data.add Book.new(1, 'title', 'author') + end + + instance_eval &its + end end \ No newline at end of file