diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 06:08:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 06:08:37 +0300 |
commit | 2399724614f3c4dcf3059038d997193830de93ee (patch) | |
tree | 3315c4453ef3efb5c1162911753436cad4f3e57d /spec/support/shared_examples/uploaders | |
parent | 6755df108b123ecc8ae330d7c7bf2f04fbf36a81 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/uploaders')
3 files changed, 8 insertions, 8 deletions
diff --git a/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb b/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb index 9263aaff89a..12bcbb8b812 100644 --- a/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb +++ b/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -shared_examples "matches the method pattern" do |method| +RSpec.shared_examples "matches the method pattern" do |method| let(:target) { subject } let(:args) { nil } let(:pattern) { patterns[method] } @@ -12,7 +12,7 @@ shared_examples "matches the method pattern" do |method| end end -shared_examples "builds correct paths" do |**patterns| +RSpec.shared_examples "builds correct paths" do |**patterns| let(:patterns) { patterns } before do diff --git a/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb b/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb index 5d605dd811b..f8b00d1e4c0 100644 --- a/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb +++ b/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -shared_context 'with storage' do |store, **stub_params| +RSpec.shared_context 'with storage' do |store, **stub_params| before do subject.object_store = store end end -shared_examples "migrates" do |to_store:, from_store: nil| +RSpec.shared_examples "migrates" do |to_store:, from_store: nil| let(:to) { to_store } let(:from) { from_store || subject.object_store } diff --git a/spec/support/shared_examples/uploaders/upload_type_shared_examples.rb b/spec/support/shared_examples/uploaders/upload_type_shared_examples.rb index 91d2526cde2..6e5075e135d 100644 --- a/spec/support/shared_examples/uploaders/upload_type_shared_examples.rb +++ b/spec/support/shared_examples/uploaders/upload_type_shared_examples.rb @@ -5,13 +5,13 @@ def check_content_matches_extension!(file = double(read: nil, path: '')) uploader.check_content_matches_extension!(magic_file) end -shared_examples 'upload passes content type check' do +RSpec.shared_examples 'upload passes content type check' do it 'does not raise error' do expect { check_content_matches_extension! }.not_to raise_error end end -shared_examples 'upload fails content type check' do +RSpec.shared_examples 'upload fails content type check' do it 'raises error' do expect { check_content_matches_extension! }.to raise_error(CarrierWave::IntegrityError) end @@ -42,7 +42,7 @@ def upload_type_checked_fixtures(upload_fixtures) end end -shared_examples 'type checked uploads' do |upload_fixtures = nil, filenames: nil| +RSpec.shared_examples 'type checked uploads' do |upload_fixtures = nil, filenames: nil| it 'check type' do upload_fixtures = Array(upload_fixtures) filenames = Array(filenames) @@ -55,7 +55,7 @@ shared_examples 'type checked uploads' do |upload_fixtures = nil, filenames: nil end end -shared_examples 'skipped type checked uploads' do |upload_fixtures = nil, filenames: nil| +RSpec.shared_examples 'skipped type checked uploads' do |upload_fixtures = nil, filenames: nil| it 'skip type check' do expect(uploader).not_to receive(:check_content_matches_extension!) |