module Workarea::TestCase::S3

Public Instance Methods

mock_s3() click to toggle source
# File lib/workarea/test_case.rb, line 168
def mock_s3
  Fog.mock!
  Workarea.s3.directories.create(key: Workarea::Configuration::S3.bucket)
  Workarea.s3.stubs(:get_bucket_cors).returns(mock_s3_cors_response)
  Workarea.s3.stubs(:put_bucket_cors)
end
mock_s3_cors_response() click to toggle source
# File lib/workarea/test_case.rb, line 179
def mock_s3_cors_response
  result = mock('Excon::Response')
  result.stubs(data: { body: { 'CORSConfiguration' => [] } })
  result
end
reset_s3() click to toggle source
# File lib/workarea/test_case.rb, line 175
def reset_s3
  Fog::Mock.reset
end