Sha256: 4e76ad9b6614efc8514d838df8352e3df6073f845e471cbb09afa7995c4971c6

Contents?: true

Size: 735 Bytes

Versions: 5

Compression:

Stored size: 735 Bytes

Contents

require 'spec_helper'

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
picky-3.0.0.pre5 spec/lib/backend/file/marshal_spec.rb
picky-3.0.0.pre4 spec/lib/backend/file/marshal_spec.rb
picky-3.0.0.pre3 spec/lib/backend/file/marshal_spec.rb
picky-3.0.0.pre2 spec/lib/backend/file/marshal_spec.rb
picky-3.0.0.pre1 spec/lib/backend/file/marshal_spec.rb