Skip to content
This repository
tag: v4.8.1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 34 lines (29 sloc) 0.729 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
# encoding: utf-8
#
require 'spec_helper'

describe Picky::Index, "Realtime API" do

  RealtimeThing = Struct.new :id, :text

  let(:index) do
    described_class.new :some_index_name do
      category :text
    end
  end

  it 'offers an add method' do
    index.add RealtimeThing.new(1, 'text')
  end
  it 'offers a remove method' do
    index.remove 1
  end
  it 'offers a replace method' do
    index.replace RealtimeThing.new(1, 'text')
  end
  it 'offers a << method' do
    index << RealtimeThing.new(1, 'text')
  end
  # it 'offers a >> method' do
  # Thing.new(1, 'text') >> index # I mean, as long as we're dreaming.
  # end
  it 'offers an unshift method' do
    index.unshift RealtimeThing.new(1, 'text')
  end

end
Something went wrong with that request. Please try again.