Sha256: daf31ea86a37ab8bd3174cfa0c475538d93d5ce71e4f4cf10d31a5369957da15

Contents?: true

Size: 920 Bytes

Versions: 4

Compression:

Stored size: 920 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'
                                                    
class VersionedMemoryCloud < AssetCloud::Base
  bucket :memory, AssetCloud::VersionedMemoryBucket
end

describe AssetCloud::VersionedMemoryBucket do    
  directory = File.dirname(__FILE__) + '/files'
                    
  before do
    @fs = VersionedMemoryCloud.new(directory , 'http://assets/files' )
    %w{one two three}.each do |content|
      @fs.write("memory/foo", content)
    end
  end
  
  describe '#read_version' do
    it "should return the appropriate data when given a key and version" do
      @fs.read_version('memory/foo', 1).should == 'one'
      @fs.read_version('memory/foo', 3).should == 'three'
    end
  end
  
  describe '#versions' do
    it "should return a list of available version identifiers for the given key" do
      @fs.versions('memory/foo').should == [1,2,3]
    end
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
Shopify-asset_cloud-0.5.2 spec/versioned_memory_bucket_spec.rb
Shopify-asset_cloud-0.5.3 spec/versioned_memory_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.2 spec/versioned_memory_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.3 spec/versioned_memory_bucket_spec.rb