Sha256: 56944a81140c9e6381a298067f5ad78e9670fea7653a16f933ce7e76f1f673f2

Contents?: true

Size: 1013 Bytes

Versions: 73

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'

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

  context 'hash-based indexes' do
    let(:marshal) { described_class.new '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 "delegates to the given hash" do
        hash = stub :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(some/cache/path/to/file.memory.dump)'
      end
    end
  end

end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
picky-4.5.8 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.7 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.6 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.5 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.4 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.3 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.2 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.1 spec/lib/backends/memory/marshal_spec.rb
picky-4.5.0 spec/lib/backends/memory/marshal_spec.rb
picky-4.4.2 spec/lib/backends/memory/marshal_spec.rb
picky-4.4.1 spec/lib/backends/memory/marshal_spec.rb
picky-4.4.0 spec/lib/backends/memory/marshal_spec.rb
picky-4.3.2 spec/lib/backends/memory/marshal_spec.rb
picky-4.3.1 spec/lib/backends/memory/marshal_spec.rb
picky-4.3.0 spec/lib/backends/memory/marshal_spec.rb
picky-4.2.4 spec/lib/backends/memory/marshal_spec.rb
picky-4.2.3 spec/lib/backends/memory/marshal_spec.rb
picky-4.2.2 spec/lib/backends/memory/marshal_spec.rb
picky-4.2.1 spec/lib/backends/memory/marshal_spec.rb
picky-4.2.0 spec/lib/backends/memory/marshal_spec.rb