diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/tasks/rubocop_rake_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/tasks/rubocop_rake_spec.rb')
-rw-r--r-- | spec/tasks/rubocop_rake_spec.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/tasks/rubocop_rake_spec.rb b/spec/tasks/rubocop_rake_spec.rb index cf7e45aae28..a92d7dc2e52 100644 --- a/spec/tasks/rubocop_rake_spec.rb +++ b/spec/tasks/rubocop_rake_spec.rb @@ -8,6 +8,7 @@ require 'fileutils' require_relative '../support/silence_stdout' require_relative '../support/helpers/next_instance_of' require_relative '../support/helpers/rake_helpers' +require_relative '../../rubocop/formatter/todo_formatter' require_relative '../../rubocop/todo_dir' RSpec.describe 'rubocop rake tasks', :silence_stdout do @@ -29,22 +30,22 @@ RSpec.describe 'rubocop rake tasks', :silence_stdout do around do |example| Dir.chdir(tmp_dir) do - with_inflections do - example.run + ::RuboCop::Formatter::TodoFormatter.with_base_directory(rubocop_todo_dir) do + with_inflections do + example.run + end end end end before do - allow(RuboCop::TodoDir).to receive(:new).and_return(todo_dir) - # This Ruby file will trigger the following 3 offenses. File.write('a.rb', <<~RUBY) a+b RUBY - # Mimic GitLab's .rubocop_todo.yml avoids relying on RuboCop's + # Mimicking GitLab's .rubocop_todo.yml avoids relying on RuboCop's # default.yml configuration. File.write('.rubocop.yml', <<~YAML) <% unless ENV['REVEAL_RUBOCOP_TODO'] == '1' %> |