Sha256: 93003f72b158d4a5ce85182433d53737fc7dc48f41fc054517124f70e7f42505

Contents?: true

Size: 1.19 KB

Versions: 55

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe Picky::Backends::File::Basic do

  context 'without options' do
    let(:basic) { described_class.new 'spec/temp/some/cache/path/to/file' }

    describe 'empty' do
      it 'returns the container that is used for indexing' do
        basic.empty.should == {}
      end
    end

    describe 'initial' do
      it 'returns the container that is used for indexing' do
        basic.initial.should == {}
      end
    end

    describe 'to_s' do
      it 'returns the cache path with the default file extension' do
        basic.to_s.should == 'Picky::Backends::File::Basic(spec/temp/some/cache/path/to/file.file.index,spec/temp/some/cache/path/to/file.file_mapping.memory.json)'
      end
    end
  end

  context 'with options' do
    let(:basic) do
      described_class.new 'spec/temp/some/cache/path/to/file',
                          empty: [],
                          initial: []
    end

    describe 'empty' do
      it 'returns the container that is used for indexing' do
        basic.empty.should == []
      end
    end

    describe 'initial' do
      it 'returns the container that is used for indexing' do
        basic.initial.should == []
      end
    end
  end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
picky-4.31.3 spec/lib/backends/file/basic_spec.rb
picky-4.31.2 spec/lib/backends/file/basic_spec.rb
picky-4.31.1 spec/lib/backends/file/basic_spec.rb
picky-4.31.0 spec/lib/backends/file/basic_spec.rb
picky-4.30.0 spec/lib/backends/file/basic_spec.rb
picky-4.29.0 spec/lib/backends/file/basic_spec.rb
picky-4.28.1 spec/lib/backends/file/basic_spec.rb
picky-4.27.1 spec/lib/backends/file/basic_spec.rb
picky-4.27.0 spec/lib/backends/file/basic_spec.rb
picky-4.26.2 spec/lib/backends/file/basic_spec.rb
picky-4.26.1 spec/lib/backends/file/basic_spec.rb
picky-4.26.0 spec/lib/backends/file/basic_spec.rb
picky-4.25.3 spec/lib/backends/file/basic_spec.rb
picky-4.25.2 spec/lib/backends/file/basic_spec.rb
picky-4.25.1 spec/lib/backends/file/basic_spec.rb
picky-4.25.0 spec/lib/backends/file/basic_spec.rb
picky-4.24.0 spec/lib/backends/file/basic_spec.rb
picky-4.23.2 spec/lib/backends/file/basic_spec.rb
picky-4.23.1 spec/lib/backends/file/basic_spec.rb
picky-4.23.0 spec/lib/backends/file/basic_spec.rb