diff options
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/build_dependencies_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 38 | ||||
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/runner_spec.rb | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/spec/models/ci/build_dependencies_spec.rb b/spec/models/ci/build_dependencies_spec.rb index ab32234eba3..f80af7b9dbc 100644 --- a/spec/models/ci/build_dependencies_spec.rb +++ b/spec/models/ci/build_dependencies_spec.rb @@ -107,7 +107,7 @@ RSpec.describe Ci::BuildDependencies, feature_category: :continuous_integration end context 'when dependencies are defined' do - let(:dependencies) { %w(rspec staging) } + let(:dependencies) { %w[rspec staging] } it { is_expected.to contain_exactly(rspec_test, staging) } end @@ -137,7 +137,7 @@ RSpec.describe Ci::BuildDependencies, feature_category: :continuous_integration end context 'when needs and dependencies are defined' do - let(:dependencies) { %w(rspec staging) } + let(:dependencies) { %w[rspec staging] } let(:needs) do [ { name: 'build', artifacts: true }, @@ -150,7 +150,7 @@ RSpec.describe Ci::BuildDependencies, feature_category: :continuous_integration end context 'when needs and dependencies contradict' do - let(:dependencies) { %w(rspec staging) } + let(:dependencies) { %w[rspec staging] } let(:needs) do [ { name: 'build', artifacts: true }, diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index e2e13ea0e17..19087d00991 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -87,7 +87,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def describe 'status' do context 'when transitioning to any state from running' do it 'removes runner_session' do - %w(success drop cancel).each do |event| + %w[success drop cancel].each do |event| build = FactoryBot.create(:ci_build, :running, :with_runner_session, pipeline: pipeline) build.fire_events!(event) @@ -1090,7 +1090,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def let(:options_with_fallback_keys) do { cache: [ - { key: "key", paths: ["public"], policy: "pull-push", fallback_keys: %w(key1 key2) } + { key: "key", paths: ["public"], policy: "pull-push", fallback_keys: %w[key1 key2] } ] } end @@ -1111,8 +1111,8 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def let(:options_with_fallback_keys) do { cache: [ - { key: "key", paths: ["public"], policy: "pull-push", fallback_keys: %w(key3 key4) }, - { key: "key2", paths: ["public"], policy: "pull-push", fallback_keys: %w(key5 key6) } + { key: "key", paths: ["public"], policy: "pull-push", fallback_keys: %w[key3 key4] }, + { key: "key2", paths: ["public"], policy: "pull-push", fallback_keys: %w[key5 key6] } ] } end @@ -1214,11 +1214,11 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def is_expected.to match([ a_hash_including({ key: 'key-1', - fallback_keys: %w(key3-1 key4-1) + fallback_keys: %w[key3-1 key4-1] }), a_hash_including({ key: 'key2-1', - fallback_keys: %w(key5-1 key6-1) + fallback_keys: %w[key5-1 key6-1] }) ]) end @@ -1241,11 +1241,11 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def is_expected.to match([ a_hash_including({ key: 'key-1', - fallback_keys: %w(key3-1 key4-1) + fallback_keys: %w[key3-1 key4-1] }), a_hash_including({ key: 'key2-1', - fallback_keys: %w(key5-1 key6-1) + fallback_keys: %w[key5-1 key6-1] }) ]) end @@ -1320,7 +1320,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def allow(build).to receive(:options).and_return({ cache: [{ key: "key1", - fallback_keys: %w(key2) + fallback_keys: %w[key2] }] }) end @@ -2951,7 +2951,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end context 'when runner is assigned to build' do - let(:runner) { create(:ci_runner, description: 'description', tag_list: %w(docker linux)) } + let(:runner) { create(:ci_runner, description: 'description', tag_list: %w[docker linux]) } before do build.update!(runner: runner) @@ -3952,8 +3952,8 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end context 'when have different tags' do - let(:build_tag_list) { %w(A B) } - let(:tag_list) { %w(C D) } + let(:build_tag_list) { %w[A B] } + let(:tag_list) { %w[C D] } it "does not match a build" do is_expected.not_to contain_exactly(build) @@ -3961,8 +3961,8 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end context 'when have a subset of tags' do - let(:build_tag_list) { %w(A B) } - let(:tag_list) { %w(A B C D) } + let(:build_tag_list) { %w[A B] } + let(:tag_list) { %w[A B C D] } it "does match a build" do is_expected.to contain_exactly(build) @@ -3971,7 +3971,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def context 'when build does not have tags' do let(:build_tag_list) { [] } - let(:tag_list) { %w(C D) } + let(:tag_list) { %w[C D] } it "does match a build" do is_expected.to contain_exactly(build) @@ -3979,8 +3979,8 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end context 'when does not have a subset of tags' do - let(:build_tag_list) { %w(A B C) } - let(:tag_list) { %w(C D) } + let(:build_tag_list) { %w[A B C] } + let(:tag_list) { %w[C D] } it "does not match a build" do is_expected.not_to contain_exactly(build) @@ -3998,7 +3998,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end context 'when does have tags' do - let(:tag_list) { %w(A B) } + let(:tag_list) { %w[A B] } it "does match a build" do is_expected.to contain_exactly(build) @@ -4676,7 +4676,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def describe '#invalid_dependencies' do let!(:pre_stage_job_valid) { create(:ci_build, :manual, pipeline: pipeline, name: 'test1', stage_idx: 0) } let!(:pre_stage_job_invalid) { create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test2', stage_idx: 1) } - let!(:job) { create(:ci_build, :pending, pipeline: pipeline, stage_idx: 2, options: { dependencies: %w(test1 test2) }) } + let!(:job) { create(:ci_build, :pending, pipeline: pipeline, stage_idx: 2, options: { dependencies: %w[test1 test2] }) } context 'when pipeline is locked' do before do diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 498af80dbb6..48d46824c11 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -207,7 +207,7 @@ RSpec.describe Ci::JobArtifact, feature_category: :build_artifacts do subject { described_class.associated_file_types_for(file_type) } where(:file_type, :result) do - 'codequality' | %w(codequality) + 'codequality' | %w[codequality] 'quality' | nil end diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index e0ca7276dc4..9d2c7e876c3 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1303,7 +1303,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep, feature_category: describe '#stages_names' do it 'returns a valid names of stages' do - expect(pipeline.stages_names).to eq(%w(build test deploy)) + expect(pipeline.stages_names).to eq(%w[build test deploy]) end end end @@ -2640,7 +2640,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep, feature_category: subject(:latest_successful_for_refs) { described_class.latest_successful_for_refs(refs) } context 'when refs are specified' do - let(:refs) { %w(first_ref second_ref third_ref) } + let(:refs) { %w[first_ref second_ref third_ref] } before do create(:ci_empty_pipeline, id: 1001, status: :success, ref: 'first_ref', sha: 'sha') diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 538eb51387e..bb9ac084ed6 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -772,7 +772,7 @@ RSpec.describe Ci::Runner, type: :model, feature_category: :runner do end context 'when runner has tags' do - let(:tag_list) { %w(bb cc) } + let(:tag_list) { %w[bb cc] } shared_examples 'tagged build picker' do it 'can handle build with matching tags' do |