Sha256: 236024670e05e81cbe6fcf3b6cbba54247a7ba2b242706635c02569fffa55ff5

Contents?: true

Size: 734 Bytes

Versions: 1

Compression:

Stored size: 734 Bytes

Contents

require 'spec_helper'

describe Picky::Backends::File::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.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::File::Marshal(some/cache/path/to/file.dump)'
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
picky-3.1.0 spec/lib/backends/file/marshal_spec.rb