Sha256: 94f6b81a815ecec23ba8e6aa1237c53830a647e5ac6173f036bad63f23422540

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true
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
    expect(@fs['tmp/image.jpg'].exist?).to(eq(false))
  end

  it "should still return nil, even if you wrote something there" do
    @fs['tmp/image.jpg'] = 'test'
    expect(@fs['tmp/image.jpg'].exist?).to(eq(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
      expect(@fs['tmp/image.jpg'].exist?).to(eq(false))
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asset_cloud-2.7.1 spec/blackhole_bucket_spec.rb
asset_cloud-2.7.0 spec/blackhole_bucket_spec.rb
asset_cloud-2.6.1 spec/blackhole_bucket_spec.rb
asset_cloud-2.6.0 spec/blackhole_bucket_spec.rb