Sha256: 0820378cf2603847e7e0dd5229e58ea7153a31f5908fbee4dfd57dc6fcdcc64c

Contents?: true

Size: 1.17 KB

Versions: 9

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'
                                                    
class BlackholeCloud < AssetCloud::Base     
  bucket AssetCloud::BlackholeBucket
end

describe BlackholeCloud do    
  directory = File.dirname(__FILE__) + '/files'
                    
  before do
    @fs = BlackholeCloud.new(directory , 'http://assets/files' )
  end                        
   
  it "should allow access to files using the [] operator" do
    @fs['tmp/image.jpg']
  end
                
  it "should return nil for non existent files" do
    @fs['tmp/image.jpg'].exist?.should == false
  end

  it "should still return nil, even if you wrote something there" do
    @fs['tmp/image.jpg'] = 'test'
    @fs['tmp/image.jpg'].exist?.should == false
  end
  
  describe "when using a sub path" do
    it "should allow access to files using the [] operator" do
      @fs['tmp/image.jpg']
    end

    it "should return nil for non existent files" do
      @fs['tmp/image.jpg'].exist?.should == false
    end

    it "should still return nil, even if you wrote something there" do
      @fs['tmp/image.jpg'] = 'test'
      @fs['tmp/image.jpg'].exist?.should == false
    end    
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
Shopify-asset_cloud-0.5.1 spec/blackhole_bucket_spec.rb
Shopify-asset_cloud-0.5.2 spec/blackhole_bucket_spec.rb
Shopify-asset_cloud-0.5.3 spec/blackhole_bucket_spec.rb
Shopify-asset_cloud-0.5.4 spec/blackhole_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.0 spec/blackhole_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.1 spec/blackhole_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.2 spec/blackhole_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.3 spec/blackhole_bucket_spec.rb
jamesmacaulay-asset_cloud-0.5.4 spec/blackhole_bucket_spec.rb