Sha256: 2e0b5f56e39cad4733a42823e4c191f3c9e17428716746809904479501d3d5b1

Contents?: true

Size: 928 Bytes

Versions: 6

Compression:

Stored size: 928 Bytes

Contents

require 'spec_helper'

describe Picky::Indexed::Bundle::Redis do

  before(:each) do
    @backend = stub :backend
    
    Picky::Backend::Redis.stub! :new => @backend
    
    @index        = Picky::Indexes::Memory.new :some_index
    @category     = Picky::Category.new :some_category, @index
    
    @similarity   = stub :similarity
    @bundle       = described_class.new :some_name, @category, @similarity
  end
  
  describe 'ids' do
    it 'delegates to the backend' do
      @backend.should_receive(:ids).once.with :some_sym
      
      @bundle.ids :some_sym
    end
  end
  
  describe 'weight' do
    it 'delegates to the backend' do
      @backend.should_receive(:weight).once.with :some_sym
      
      @bundle.weight :some_sym
    end
  end
  
  describe '[]' do
    it 'delegates to the backend' do
      @backend.should_receive(:setting).once.with :some_sym
      
      @bundle[:some_sym]
    end
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
picky-3.0.1 spec/lib/indexed/bundle/redis_spec.rb
picky-3.0.0 spec/lib/indexed/bundle/redis_spec.rb
picky-3.0.0.pre5 spec/lib/indexed/bundle/redis_spec.rb
picky-3.0.0.pre4 spec/lib/indexed/bundle/redis_spec.rb
picky-3.0.0.pre3 spec/lib/indexed/bundle/redis_spec.rb
picky-3.0.0.pre2 spec/lib/indexed/bundle/redis_spec.rb