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/rubocop/formatter/todo_formatter_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/rubocop/formatter/todo_formatter_spec.rb')
-rw-r--r-- | spec/rubocop/formatter/todo_formatter_spec.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/rubocop/formatter/todo_formatter_spec.rb b/spec/rubocop/formatter/todo_formatter_spec.rb index e1b1de33bfe..fcff028f07d 100644 --- a/spec/rubocop/formatter/todo_formatter_spec.rb +++ b/spec/rubocop/formatter/todo_formatter_spec.rb @@ -14,17 +14,18 @@ RSpec.describe RuboCop::Formatter::TodoFormatter do let(:real_tmp_dir) { File.join(tmp_dir, 'real') } let(:symlink_tmp_dir) { File.join(tmp_dir, 'symlink') } let(:rubocop_todo_dir) { "#{symlink_tmp_dir}/.rubocop_todo" } - let(:options) { { rubocop_todo_dir: rubocop_todo_dir } } let(:todo_dir) { RuboCop::TodoDir.new(rubocop_todo_dir) } - subject(:formatter) { described_class.new(stdout, options) } + subject(:formatter) { described_class.new(stdout) } around do |example| FileUtils.mkdir(real_tmp_dir) FileUtils.symlink(real_tmp_dir, symlink_tmp_dir) Dir.chdir(symlink_tmp_dir) do - example.run + described_class.with_base_directory(rubocop_todo_dir) do + example.run + end end end @@ -38,8 +39,6 @@ RSpec.describe RuboCop::Formatter::TodoFormatter do let(:offense_autocorrect) { fake_offense('B/AutoCorrect') } before do - stub_const("#{described_class}::MAX_OFFENSE_COUNT", 1) - stub_rubocop_registry( 'A/Offense' => { autocorrectable: false }, 'B/AutoCorrect' => { autocorrectable: true } |