Skip to content

Commit

Permalink
Merge pull request #2257 from sul-dlss/rubocop-updates
Browse files Browse the repository at this point in the history
Enable new cops and fix linting errors
  • Loading branch information
justinlittman authored Aug 15, 2023
2 parents e7a99ba + 9f07793 commit f67e269
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,19 @@ RSpec/IndexedLet: # new in 2.20
RSpec/MatchArray: # new in 2.19
Enabled: true

Lint/MixedCaseRange: # new in 1.53
Enabled: true
Lint/RedundantRegexpQuantifiers: # new in 1.53
Enabled: true
Style/RedundantCurrentDirectoryInPath: # new in 1.53
Enabled: true
Style/RedundantRegexpArgument: # new in 1.53
Enabled: true
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
Enabled: true
Style/YAMLFileRead: # new in 1.53
Enabled: true
RSpec/ReceiveMessages: # new in 2.23
Enabled: true
RSpec/Rails/NegationBeValid: # new in 2.23
Enabled: true
3 changes: 1 addition & 2 deletions spec/models/replication/druid_version_zip_part_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
let(:md5) { 'fakemd5' }

before do
allow(part).to receive(:md5).and_return(md5)
allow(part).to receive(:md5_path).and_return(md5_path)
allow(part).to receive_messages(md5: md5, md5_path: md5_path)
end

it 'writes the md5 to the md5_path' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
before do
allow(Audit::Results).to receive(:new).and_return(results)
allow(provider_class).to receive(:new).and_return(provider)
allow(provider).to receive(:bucket).and_return(bucket)
allow(provider).to receive(:bucket_name).and_return(bucket_name)
allow(provider).to receive_messages(bucket: bucket, bucket_name: bucket_name)
end

context 'some parts are unreplicated' do
Expand Down
3 changes: 1 addition & 2 deletions spec/services/dashboard/replication_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@

context 'when replication_ok? and zip_parts_ok? are both true' do
before do
allow(test_class).to receive(:replication_ok?).and_return(true)
allow(test_class).to receive(:zip_parts_ok?).and_return(true)
allow(test_class).to receive_messages(replication_ok?: true, zip_parts_ok?: true)
end

it 'returns true' do
Expand Down
3 changes: 1 addition & 2 deletions spec/services/moab_record_service/update_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@
context 'ActiveRecordError' do
let(:results) do
allow(Rails.logger).to receive(:log)
allow(moab_record_service).to receive(:preserved_object).and_return(preserved_object)
allow(moab_record_service).to receive(:moab_record).and_return(moab_record)
allow(moab_record_service).to receive_messages(preserved_object: preserved_object, moab_record: moab_record)
allow(moab_record).to receive(:save!).and_raise(ActiveRecord::ActiveRecordError, 'foo')
moab_record_service.execute.results
end
Expand Down

0 comments on commit f67e269

Please sign in to comment.