diff options
Diffstat (limited to 'spec/lib/gitlab/cleanup/project_uploads_spec.rb')
-rw-r--r-- | spec/lib/gitlab/cleanup/project_uploads_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/lib/gitlab/cleanup/project_uploads_spec.rb b/spec/lib/gitlab/cleanup/project_uploads_spec.rb index 05d744d95e2..a99bdcc9a0f 100644 --- a/spec/lib/gitlab/cleanup/project_uploads_spec.rb +++ b/spec/lib/gitlab/cleanup/project_uploads_spec.rb @@ -15,10 +15,10 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do describe '#run!' do shared_examples_for 'moves the file' do shared_examples_for 'a real run' do - let(:args) { [dry_run: false] } + let(:args) { { dry_run: false } } it 'moves the file to its proper location' do - subject.run!(*args) + subject.run!(**args) expect(File.exist?(path)).to be_falsey expect(File.exist?(new_path)).to be_truthy @@ -28,13 +28,13 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up...") expect(logger).to receive(:info).with("Did #{action}") - subject.run!(*args) + subject.run!(**args) end end shared_examples_for 'a dry run' do it 'does not move the file' do - subject.run!(*args) + subject.run!(**args) expect(File.exist?(path)).to be_truthy expect(File.exist?(new_path)).to be_falsey @@ -44,30 +44,30 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up. Dry run...") expect(logger).to receive(:info).with("Can #{action}") - subject.run!(*args) + subject.run!(**args) end end context 'when dry_run is false' do - let(:args) { [dry_run: false] } + let(:args) { { dry_run: false } } it_behaves_like 'a real run' end context 'when dry_run is nil' do - let(:args) { [dry_run: nil] } + let(:args) { { dry_run: nil } } it_behaves_like 'a real run' end context 'when dry_run is true' do - let(:args) { [dry_run: true] } + let(:args) { { dry_run: true } } it_behaves_like 'a dry run' end context 'with dry_run not specified' do - let(:args) { [] } + let(:args) { {} } it_behaves_like 'a dry run' end |