Sha256: c004bd4ec6c4b17838a74355a8d5a35c25c5b468b0d891965a3e65c49480b493

Contents?: true

Size: 989 Bytes

Versions: 91

Compression:

Stored size: 989 Bytes

Contents

require 'spec_helper'

describe Picky::Indexes do

  let(:index) { stub :some_index, :name => :some_index }

  context 'with instance' do
    let(:indexes) { Picky::Indexes.new }

    describe 'indexes' do
      it 'exists' do
        lambda { indexes.indexes }.should_not raise_error
      end
      it 'is empty by default' do
        indexes.indexes.should be_empty
      end
    end
  end

  context 'with singleton' do
    let(:indexes) { Picky::Indexes.instance }

    describe 'indexes' do
      it 'exists' do
        lambda { indexes.indexes }.should_not raise_error
      end
    end

    describe 'clear_indexes' do
      it 'clears the indexes' do
        indexes.register index

        indexes.clear_indexes

        indexes.indexes.should == []
      end
    end

    describe 'register' do
      it 'adds the given index to the indexes' do
        indexes.clear_indexes

        indexes.register index

        indexes.indexes.should == [index]
      end
    end
  end

end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
picky-4.3.1 spec/lib/indexes_spec.rb
picky-4.3.0 spec/lib/indexes_spec.rb
picky-4.2.4 spec/lib/indexes_spec.rb
picky-4.2.3 spec/lib/indexes_spec.rb
picky-4.2.2 spec/lib/indexes_spec.rb
picky-4.2.1 spec/lib/indexes_spec.rb
picky-4.2.0 spec/lib/indexes_spec.rb
picky-4.1.0 spec/lib/indexes_spec.rb
picky-4.0.9 spec/lib/indexes_spec.rb
picky-4.0.8 spec/lib/indexes_spec.rb
picky-4.0.7 spec/lib/indexes_spec.rb
picky-4.0.6 spec/lib/indexes_spec.rb
picky-4.0.5 spec/lib/indexes_spec.rb
picky-4.0.4 spec/lib/indexes_spec.rb
picky-4.0.3 spec/lib/indexes_spec.rb
picky-4.0.1 spec/lib/indexes_spec.rb
picky-4.0.0 spec/lib/indexes_spec.rb
picky-4.0.0pre6 spec/lib/indexes_spec.rb
picky-4.0.0pre5 spec/lib/indexes_spec.rb
picky-4.0.0pre3 spec/lib/indexes_spec.rb