Sha256: efe0eac1c75df67dcf22e524ebb10361eec0b940c89e7e9ebad1dd387611f0a6

Contents?: true

Size: 892 Bytes

Versions: 3

Compression:

Stored size: 892 Bytes

Contents

require 'spec_helper'

describe Index::Type do
  
  context "with categories" do
    before(:each) do
      @categories = stub :categories
      
      @index = Index::Type.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
      Index::Type.new :some_name
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picky-0.11.2 spec/lib/index/type_spec.rb
picky-0.11.1 spec/lib/index/type_spec.rb
picky-0.11.0 spec/lib/index/type_spec.rb