Sha256: 58658215fe20da47547a7d30a48b119b76c7050bdc0e7e41f26a5fbd683721ee
Contents?: true
Size: 1017 Bytes
Versions: 16
Compression:
Stored size: 1017 Bytes
Contents
module Adhoq RSpec.describe GlobalVariable, type: :model do def reset_storage_config(*storage_config) Adhoq.instance_variable_set('@current_storage', nil) Adhoq.config.storage = storage_config end around(:each) do |example| begin original_config = Adhoq.config.storage example.run ensure reset_storage_config(*original_config) end end context 'config.storage = [:local_file, ....]' do before do reset_storage_config(:local_file, Rails.root + "/tmp/adhoq/#{Rails.env}") end specify do expect(Adhoq.current_storage).to be_instance_of Adhoq::Storage::LocalFile end end context 'config.storage = [:s3, ....]' do before do reset_storage_config(:s3, 'my-bucket-name', aws_access_key_id: 'key-id', aws_secret_access_key: 'secret', region: 'paris-01') end specify do expect(Adhoq.current_storage).to be_instance_of Adhoq::Storage::S3 end end end end
Version data entries
16 entries across 16 versions & 1 rubygems