From f8881a1e405458b0fd8b8c11e7899e6fddd9be74 Mon Sep 17 00:00:00 2001 From: Eric O Date: Tue, 17 Dec 2024 14:36:50 -0500 Subject: [PATCH] Rubocop fixes --- .rubocop.yml | 10 ++++++---- spec/atc/directory_reader_spec.rb | 14 ++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4a48f72..d3f273e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,15 +33,17 @@ Metrics/ClassLength: Metrics/MethodLength: Exclude: - lib/atc/aip_reader.rb - - 'lib/atc/loaders/checksum_loader.rb' - - 'lib/atc/utils/aws_multipart_checksum_utils.rb' - - 'lib/atc/aws/s3_uploader.rb' - - 'lib/atc/utils/aws_checksum_utils.rb' + - lib/atc/directory_reader.rb + - lib/atc/loaders/checksum_loader.rb + - lib/atc/utils/aws_multipart_checksum_utils.rb + - lib/atc/aws/s3_uploader.rb + - lib/atc/utils/aws_checksum_utils.rb Rails/Output: Exclude: - 'lib/atc/aws/s3_uploader.rb' - 'lib/atc/aip_reader.rb' + - 'lib/atc/directory_reader.rb' Lint/MissingCopEnableDirective: Enabled: false diff --git a/spec/atc/directory_reader_spec.rb b/spec/atc/directory_reader_spec.rb index 1907a4b..9f20cf5 100644 --- a/spec/atc/directory_reader_spec.rb +++ b/spec/atc/directory_reader_spec.rb @@ -7,7 +7,8 @@ let(:path_to_directory_fixture_copy) do tmpdir_path = Dir.mktmpdir('sample_directory_') - FileUtils.cp_r("#{file_fixture('sample_directory')}/.", tmpdir_path) # copy the CONTENTS of path_to_directory_fixture to tmpdir_path + # copy the CONTENTS of path_to_directory_fixture to tmpdir_path + FileUtils.cp_r("#{file_fixture('sample_directory')}/.", tmpdir_path) tmpdir_path end @@ -51,13 +52,18 @@ expect(described_class.generate_file_list(path_to_directory_fixture_copy).sort).to eq(expected_file_list.sort) end - it 'raises an exception when some files in the directory are not readable, and the error message lists the unreadable files' do + it 'raises an exception when some files in the directory are not readable, '\ + 'and the error message lists the unreadable files' do # all files readable by default allow(File).to receive(:readable?).and_return(true) # pretend that sample-file1.txt is not readable - allow(File).to receive(:readable?).with(File.join(path_to_directory_fixture_copy, 'sample-file1.txt')).and_return(false) + allow(File).to receive(:readable?).with( + File.join(path_to_directory_fixture_copy, 'sample-file1.txt') + ).and_return(false) # pretend that sample-file2.txt is not readable - allow(File).to receive(:readable?).with(File.join(path_to_directory_fixture_copy, 'sample-file2.txt')).and_return(false) + allow(File).to receive(:readable?).with( + File.join(path_to_directory_fixture_copy, 'sample-file2.txt') + ).and_return(false) expect { described_class.generate_file_list(path_to_directory_fixture_copy) }.to raise_error(