diff options
author | Rémy Coutable <remy@rymai.me> | 2018-03-29 12:47:54 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-04-23 13:20:30 +0300 |
commit | 023d4f6f2f3d88d0966fe01e6ef921fd03a309fe (patch) | |
tree | 6aabb650fe2ba200222c57f1a4ac66ff0a9143e8 /spec/support/stub_object_storage.rb | |
parent | eb1cb7bed6951bdda54abd55e86fd793e6954a56 (diff) |
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support/stub_object_storage.rb')
-rw-r--r-- | spec/support/stub_object_storage.rb | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/spec/support/stub_object_storage.rb b/spec/support/stub_object_storage.rb deleted file mode 100644 index 6e88641da42..00000000000 --- a/spec/support/stub_object_storage.rb +++ /dev/null @@ -1,48 +0,0 @@ -module StubConfiguration - def stub_object_storage_uploader( - config:, - uploader:, - remote_directory:, - enabled: true, - proxy_download: false, - background_upload: false, - direct_upload: false - ) - allow(config).to receive(:enabled) { enabled } - allow(config).to receive(:proxy_download) { proxy_download } - allow(config).to receive(:background_upload) { background_upload } - allow(config).to receive(:direct_upload) { direct_upload } - - return unless enabled - - Fog.mock! - - ::Fog::Storage.new(uploader.object_store_credentials).tap do |connection| - begin - connection.directories.create(key: remote_directory) - rescue Excon::Error::Conflict - end - end - end - - def stub_artifacts_object_storage(**params) - stub_object_storage_uploader(config: Gitlab.config.artifacts.object_store, - uploader: JobArtifactUploader, - remote_directory: 'artifacts', - **params) - end - - def stub_lfs_object_storage(**params) - stub_object_storage_uploader(config: Gitlab.config.lfs.object_store, - uploader: LfsObjectUploader, - remote_directory: 'lfs-objects', - **params) - end - - def stub_uploads_object_storage(uploader = described_class, **params) - stub_object_storage_uploader(config: Gitlab.config.uploads.object_store, - uploader: uploader, - remote_directory: 'uploads', - **params) - end -end |