Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 34 lines (29 sloc) 0.729 kb
2f895f8 @floere + unshift, << to index, category as realtime methods.
authored
1 # encoding: utf-8
2 #
3 require 'spec_helper'
4
5 describe Picky::Index, "Realtime API" do
6
42824d7 @floere - loading analyzer by default
authored
7 RealtimeThing = Struct.new :id, :text
2f895f8 @floere + unshift, << to index, category as realtime methods.
authored
8
9 let(:index) do
10 described_class.new :some_index_name do
11 category :text
12 end
13 end
14
15 it 'offers an add method' do
42824d7 @floere - loading analyzer by default
authored
16 index.add RealtimeThing.new(1, 'text')
2f895f8 @floere + unshift, << to index, category as realtime methods.
authored
17 end
18 it 'offers a remove method' do
19 index.remove 1
20 end
21 it 'offers a replace method' do
42824d7 @floere - loading analyzer by default
authored
22 index.replace RealtimeThing.new(1, 'text')
2f895f8 @floere + unshift, << to index, category as realtime methods.
authored
23 end
24 it 'offers a << method' do
42824d7 @floere - loading analyzer by default
authored
25 index << RealtimeThing.new(1, 'text')
2f895f8 @floere + unshift, << to index, category as realtime methods.
authored
26 end
27 # it 'offers a >> method' do
28 # Thing.new(1, 'text') >> index # I mean, as long as we're dreaming.
29 # end
30 it 'offers an unshift method' do
42824d7 @floere - loading analyzer by default
authored
31 index.unshift RealtimeThing.new(1, 'text')
2f895f8 @floere + unshift, << to index, category as realtime methods.
authored
32 end
33
34 end
Something went wrong with that request. Please try again.