Sha256: 13ec1273e8b67361b6ab6e2e9b3b4d3e5bc923b32077a86ae32cd9244ef30925

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

require '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

21 entries across 21 versions & 1 rubygems

Version Path
asset_cloud-2.5.3 spec/blackhole_bucket_spec.rb
asset_cloud-2.5.2 spec/blackhole_bucket_spec.rb
asset_cloud-2.5.1 spec/blackhole_bucket_spec.rb
asset_cloud-2.5.0 spec/blackhole_bucket_spec.rb
asset_cloud-2.4.0 spec/blackhole_bucket_spec.rb
asset_cloud-2.3.1 spec/blackhole_bucket_spec.rb
asset_cloud-2.3.0 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.9 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.8 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.7 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.6 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.5 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.4 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.2 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.1 spec/blackhole_bucket_spec.rb
asset_cloud-2.2.0 spec/blackhole_bucket_spec.rb
asset_cloud-2.1.0 spec/blackhole_bucket_spec.rb
asset_cloud-2.0.0 spec/blackhole_bucket_spec.rb
asset_cloud-1.1.1 spec/blackhole_bucket_spec.rb
asset_cloud-1.1.0 spec/blackhole_bucket_spec.rb