Sha256: 1eb4722ef2836be0a6c95e91d7a5c10b92092389119461d00be360607b1e8dde

Contents?: true

Size: 752 Bytes

Versions: 11

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'

describe Picky::Backends::Memory::Marshal do
  
  let(:file) { described_class.new 'some/cache/path/to/file' }
  
  describe "dump" do
    it "delegates to the given hash" do
      hash = stub :hash
      
      hash.should_receive(:dump_marshal).once.with "some/cache/path/to/file.memory.dump"
      
      file.dump hash
    end
  end
  
  describe "retrieve" do
    it "raises" do
      lambda do
        file.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
      file.to_s.should == 'Picky::Backends::Memory::Marshal(some/cache/path/to/file.memory.dump)'
    end
  end
  
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
picky-3.1.11 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.10 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.9 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.8 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.7 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.6 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.5 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.4 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.3 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.2 spec/lib/backends/memory/marshal_spec.rb
picky-3.1.1 spec/lib/backends/memory/marshal_spec.rb