diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-18 06:11:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-18 06:11:42 +0300 |
commit | c3df0504a2212528bd792fb0cdad539189a6219e (patch) | |
tree | c35951d6c20bb17b13aeb3ff7b48a18d8c7cdc86 /spec/rubocop | |
parent | 977fd0aff3a3fe6bcb6f4c76d6f2f7696b958412 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop')
-rw-r--r-- | spec/rubocop/cop/rspec/env_mocking_spec.rb | 12 | ||||
-rw-r--r-- | spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb | 8 | ||||
-rw-r--r-- | spec/rubocop/formatter/graceful_formatter_spec.rb | 27 |
3 files changed, 24 insertions, 23 deletions
diff --git a/spec/rubocop/cop/rspec/env_mocking_spec.rb b/spec/rubocop/cop/rspec/env_mocking_spec.rb index 189fccf483a..fec2000c88b 100644 --- a/spec/rubocop/cop/rspec/env_mocking_spec.rb +++ b/spec/rubocop/cop/rspec/env_mocking_spec.rb @@ -34,23 +34,23 @@ RSpec.describe RuboCop::Cop::RSpec::EnvMocking, feature_category: :tooling do context 'with mocking bracket calls ' do it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env', - offense_call_brackets_string_quotes, %(stub_env('FOO', 'bar')) + offense_call_brackets_string_quotes, %(stub_env('FOO', 'bar')) it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env', - offense_call_brackets_variables, %(stub_env(key, value)) + offense_call_brackets_variables, %(stub_env(key, value)) end context 'with mocking fetch calls' do it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env', - offense_call_fetch_string_quotes, %(stub_env('FOO', 'bar')) + offense_call_fetch_string_quotes, %(stub_env('FOO', 'bar')) it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env', - offense_call_fetch_variables, %(stub_env(key, value)) + offense_call_fetch_variables, %(stub_env(key, value)) end context 'with other special cases and variations' do it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env', - offense_call_root_env_variables, %(stub_env(key, value)) + offense_call_root_env_variables, %(stub_env(key, value)) it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env', - offense_call_key_value_method_calls, %(stub_env(fetch_key(object), fetch_value(object))) + offense_call_key_value_method_calls, %(stub_env(fetch_key(object), fetch_value(object))) end context 'with acceptable cases' do diff --git a/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb b/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb index 1d1c0852db2..d2ccd504fcd 100644 --- a/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb +++ b/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb @@ -10,10 +10,10 @@ require_relative '../../../../rubocop/cop/style/regexp_literal_mixed_preserve' RSpec.describe RuboCop::Cop::Style::RegexpLiteralMixedPreserve, :config do let(:config) do supported_styles = { 'SupportedStyles' => %w[slashes percent_r mixed mixed_preserve] } - RuboCop::Config.new('Style/PercentLiteralDelimiters' => - percent_literal_delimiters_config, - 'Style/RegexpLiteralMixedPreserve' => - cop_config.merge(supported_styles)) + RuboCop::Config.new( + 'Style/PercentLiteralDelimiters' => percent_literal_delimiters_config, + 'Style/RegexpLiteralMixedPreserve' => cop_config.merge(supported_styles) + ) end let(:percent_literal_delimiters_config) { { 'PreferredDelimiters' => { '%r' => '{}' } } } diff --git a/spec/rubocop/formatter/graceful_formatter_spec.rb b/spec/rubocop/formatter/graceful_formatter_spec.rb index d76e566e2b4..b9a56bec115 100644 --- a/spec/rubocop/formatter/graceful_formatter_spec.rb +++ b/spec/rubocop/formatter/graceful_formatter_spec.rb @@ -220,19 +220,20 @@ RSpec.describe RuboCop::Formatter::GracefulFormatter, :isolated_environment do def fake_offense(cop_name) # rubocop:disable RSpec/VerifiedDoubles - double(:offense, - cop_name: cop_name, - corrected?: false, - correctable?: false, - severity: double(:severity, name: :convention, code: :C), - line: 5, - column: 23, - real_column: 23, - corrected_with_todo?: false, - message: "#{cop_name} message", - location: double(:location, source_line: 'line', first_line: 1, last_line: 1, single_line?: true), - highlighted_area: double(:highlighted_area, begin_pos: 1, size: 2, source_buffer: 'line', source: 'i') - ) + double( + :offense, + cop_name: cop_name, + corrected?: false, + correctable?: false, + severity: double(:severity, name: :convention, code: :C), + line: 5, + column: 23, + real_column: 23, + corrected_with_todo?: false, + message: "#{cop_name} message", + location: double(:location, source_line: 'line', first_line: 1, last_line: 1, single_line?: true), + highlighted_area: double(:highlighted_area, begin_pos: 1, size: 2, source_buffer: 'line', source: 'i') + ) # rubocop:enable RSpec/VerifiedDoubles end end |