Sha256: cd2275604aea8c8ce092a3db28c9d99dde4d37bd42df28c12417bb516828bd3c

Contents?: true

Size: 901 Bytes

Versions: 4

Compression:

Stored size: 901 Bytes

Contents

require 'spec_helper'

describe Indexed::Index do
  
  context "with categories" do
    before(:each) do
      @categories = stub :categories
      
      @index = Indexed::Index.new :some_name
      @index.add_category :some_category_name1
      @index.add_category :some_category_name2
      
      @index.stub! :categories => @categories
    end

    describe "load_from_cache" do
      it "delegates to each category" do
        @categories.should_receive(:load_from_cache).once.with
        
        @index.load_from_cache
      end
    end
    describe "possible_combinations" do
      it "delegates to the combinator" do
        @categories.should_receive(:possible_combinations_for).once.with :some_token
        
        @index.possible_combinations :some_token
      end
    end
  end
  
  context "no categories" do
    it "works" do
      Indexed::Index.new :some_name
    end
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
picky-0.12.3 spec/lib/indexed/index_spec.rb
picky-0.12.2 spec/lib/indexed/index_spec.rb
picky-0.12.1 spec/lib/indexed/index_spec.rb
picky-0.12.0 spec/lib/indexed/index_spec.rb