Sha256: 136a08fcee7de1681c18865fde804004a3ede0bf943234eed7fd5b077b749472

Contents?: true

Size: 813 Bytes

Versions: 3

Compression:

Stored size: 813 Bytes

Contents

module Adhoq
  RSpec.describe Storage, type: :model do
    describe Storage::LocalFile do
      tempdir = __dir__ + '/../../tmp/adhoq_storage.test'

      after(:all) do
        FileUtils.rm_rf(tempdir)
      end

      let(:storage) { Storage::LocalFile.new(tempdir) }

      let(:identifier) do
        storage.store('.txt') { StringIO.new("Hello adhoq!\n") }
      end

      specify { expect(storage.get(identifier)).to eq "Hello adhoq!\n" }
    end

    describe Storage::S3, :fog_mock do
      let(:storage) { Storage::S3.new('my-adhoq-bucket', aws_access_key_id: 'key_id', aws_secret_access_key: 'access_key') }

      let(:identifier) do
        storage.store('.txt') { StringIO.new("Hello adhoq!\n") }
      end

      specify { expect(storage.get(identifier)).to eq "Hello adhoq!\n" }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adhoq-0.0.5 spec/adhoq/storage_spec.rb
adhoq-0.0.4 spec/adhoq/storage_spec.rb
adhoq-0.0.3 spec/adhoq/storage_spec.rb