summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/asciidoc_spec.rb1
-rw-r--r--spec/lib/gitlab/ci/config/entry/cache_spec.rb6
-rw-r--r--spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb4
-rw-r--r--spec/lib/gitlab/experimentation_spec.rb4
-rw-r--r--spec/lib/gitlab/gitaly_client/blob_service_spec.rb2
-rw-r--r--spec/lib/gitlab/gitaly_client/remote_service_spec.rb2
-rw-r--r--spec/lib/gitlab/phabricator_import/conduit/user_spec.rb6
-rw-r--r--spec/lib/gitlab/phabricator_import/user_finder_spec.rb2
-rw-r--r--spec/lib/gitlab/quick_actions/dsl_spec.rb2
9 files changed, 14 insertions, 15 deletions
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb
index 38ec04ebe81..ba5b70b44de 100644
--- a/spec/lib/gitlab/asciidoc_spec.rb
+++ b/spec/lib/gitlab/asciidoc_spec.rb
@@ -481,7 +481,6 @@ module Gitlab
['../sample.adoc', 'doc/sample.adoc', 'relative path to a file up one directory'],
['../../sample.adoc', 'sample.adoc', 'relative path for a file up multiple directories']
].each do |include_path_, file_path_, desc|
-
context "the file is specified by #{desc}" do
let(:include_path) { include_path_ }
let(:file_path) { file_path_ }
diff --git a/spec/lib/gitlab/ci/config/entry/cache_spec.rb b/spec/lib/gitlab/ci/config/entry/cache_spec.rb
index 4fa0a57dc82..f7b14360af3 100644
--- a/spec/lib/gitlab/ci/config/entry/cache_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/cache_spec.rb
@@ -31,13 +31,13 @@ describe Gitlab::Ci::Config::Entry::Cache do
it_behaves_like 'hash key value'
context 'with files' do
- let(:key) { { files: ['a-file', 'other-file'] } }
+ let(:key) { { files: %w[a-file other-file] } }
it_behaves_like 'hash key value'
end
context 'with files and prefix' do
- let(:key) { { files: ['a-file', 'other-file'], prefix: 'prefix-value' } }
+ let(:key) { { files: %w[a-file other-file], prefix: 'prefix-value' } }
it_behaves_like 'hash key value'
end
@@ -55,7 +55,7 @@ describe Gitlab::Ci::Config::Entry::Cache do
it { is_expected.to be_valid }
context 'with files' do
- let(:key) { { files: ['a-file', 'other-file'] } }
+ let(:key) { { files: %w[a-file other-file] } }
it { is_expected.to be_valid }
end
diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
index b09258ae227..56767c21ab7 100644
--- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
+++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
@@ -6,12 +6,12 @@ shared_examples 'renames child namespaces' do |type|
it 'renames namespaces' do
rename_namespaces = double
expect(described_class::RenameNamespaces)
- .to receive(:new).with(['first-path', 'second-path'], subject)
+ .to receive(:new).with(%w[first-path second-path], subject)
.and_return(rename_namespaces)
expect(rename_namespaces).to receive(:rename_namespaces)
.with(type: :child)
- subject.rename_wildcard_paths(['first-path', 'second-path'])
+ subject.rename_wildcard_paths(%w[first-path second-path])
end
end
diff --git a/spec/lib/gitlab/experimentation_spec.rb b/spec/lib/gitlab/experimentation_spec.rb
index b8be72cf8d7..e4624accd58 100644
--- a/spec/lib/gitlab/experimentation_spec.rb
+++ b/spec/lib/gitlab/experimentation_spec.rb
@@ -54,7 +54,7 @@ describe Gitlab::Experimentation do
describe '#experiment_enabled?' do
context 'cookie is not present' do
it 'calls Gitlab::Experimentation.enabled_for_user? with the name of the experiment and an experimentation_subject_index of nil' do
- expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, nil) # rubocop:disable RSpec/DescribedClass
+ expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, nil)
controller.experiment_enabled?(:test_experiment)
end
end
@@ -67,7 +67,7 @@ describe Gitlab::Experimentation do
it 'calls Gitlab::Experimentation.enabled_for_user? with the name of the experiment and an experimentation_subject_index of the modulo 100 of the hex value of the uuid' do
# 'abcd1234'.hex % 100 = 76
- expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, 76) # rubocop:disable RSpec/DescribedClass
+ expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, 76)
controller.experiment_enabled?(:test_experiment)
end
end
diff --git a/spec/lib/gitlab/gitaly_client/blob_service_spec.rb b/spec/lib/gitlab/gitaly_client/blob_service_spec.rb
index 887a6baf659..fc6ac491671 100644
--- a/spec/lib/gitlab/gitaly_client/blob_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/blob_service_spec.rb
@@ -12,7 +12,7 @@ describe Gitlab::GitalyClient::BlobService do
describe '#get_new_lfs_pointers' do
let(:revision) { 'master' }
let(:limit) { 5 }
- let(:not_in) { ['branch-a', 'branch-b'] }
+ let(:not_in) { %w[branch-a branch-b] }
let(:expected_params) do
{ revision: revision, limit: limit, not_in_refs: not_in, not_in_all: false }
end
diff --git a/spec/lib/gitlab/gitaly_client/remote_service_spec.rb b/spec/lib/gitlab/gitaly_client/remote_service_spec.rb
index 929ff5dee5d..73ae4cd95ce 100644
--- a/spec/lib/gitlab/gitaly_client/remote_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/remote_service_spec.rb
@@ -69,7 +69,7 @@ describe Gitlab::GitalyClient::RemoteService do
describe '#update_remote_mirror' do
let(:ref_name) { 'remote_mirror_1' }
- let(:only_branches_matching) { ['my-branch', 'master'] }
+ let(:only_branches_matching) { %w[my-branch master] }
let(:ssh_key) { 'KEY' }
let(:known_hosts) { 'KNOWN HOSTS' }
diff --git a/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb
index e88eec2c393..f3928f390bc 100644
--- a/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb
+++ b/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb
@@ -15,13 +15,13 @@ describe Gitlab::PhabricatorImport::Conduit::User do
it 'calls the api with the correct params' do
expected_params = {
- constraints: { phids: ['phid-1', 'phid-2'] }
+ constraints: { phids: %w[phid-1 phid-2] }
}
expect(fake_client).to receive(:get).with('user.search',
params: expected_params)
- user_client.users(['phid-1', 'phid-2'])
+ user_client.users(%w[phid-1 phid-2])
end
it 'returns an array of parsed responses' do
@@ -43,7 +43,7 @@ describe Gitlab::PhabricatorImport::Conduit::User do
expect(fake_client).to receive(:get).with('user.search',
params: second_params).once
- user_client.users(['phid-1', 'phid-2'])
+ user_client.users(%w[phid-1 phid-2])
end
end
end
diff --git a/spec/lib/gitlab/phabricator_import/user_finder_spec.rb b/spec/lib/gitlab/phabricator_import/user_finder_spec.rb
index 14a00deeb16..f260e38b7c8 100644
--- a/spec/lib/gitlab/phabricator_import/user_finder_spec.rb
+++ b/spec/lib/gitlab/phabricator_import/user_finder_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do
let(:project) { create(:project, namespace: create(:group)) }
- subject(:finder) { described_class.new(project, ['first-phid', 'second-phid']) }
+ subject(:finder) { described_class.new(project, %w[first-phid second-phid]) }
before do
project.namespace.add_developer(existing_user)
diff --git a/spec/lib/gitlab/quick_actions/dsl_spec.rb b/spec/lib/gitlab/quick_actions/dsl_spec.rb
index c98c36622f5..1145a7edc85 100644
--- a/spec/lib/gitlab/quick_actions/dsl_spec.rb
+++ b/spec/lib/gitlab/quick_actions/dsl_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::QuickActions::Dsl do
before :all do
DummyClass = Struct.new(:project) do
- include Gitlab::QuickActions::Dsl # rubocop:disable RSpec/DescribedClass
+ include Gitlab::QuickActions::Dsl
desc 'A command with no args'
command :no_args, :none do