Sha256: 49a5941838d8b54726622ddebc179e71135af8cfe503d63a9ad4f3560afdc092

Contents?: true

Size: 1.01 KB

Versions: 30

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe Picky::Backends::Memory::Marshal do

  context 'hash-based indexes' do
    let(:marshal) { described_class.new 'spec/temp/some/cache/path/to/file' }

    describe 'extension' do
      it 'is correct' do
        marshal.extension.should == :dump
      end
    end

    describe 'initial' do
      it 'is correct' do
        marshal.initial.should == {}
      end
    end

    describe "dump" do
      it "forwards to the given hash" do
        hash = double :hash

        marshal.should_receive(:dump_marshal).once.with hash

        marshal.dump hash
      end
    end

    describe "retrieve" do
      it "raises" do
        lambda do
          marshal.retrieve
        end.should raise_error("Can't retrieve from marshalled file. Use text file.")
      end
    end

    describe 'to_s' do
      it 'returns the cache path with the default file extension' do
        marshal.to_s.should == 'Picky::Backends::Memory::Marshal(spec/temp/some/cache/path/to/file.memory.dump)'
      end
    end
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

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