Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
likhitha77 committed Jan 8, 2024
1 parent 018ac08 commit a8ea9c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 9 additions & 8 deletions spec/lib/rmt/mirror/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
end

let(:downloader) { instance_double('downloader') }

let(:logger) { instance_double('RMT::Logger') }

before do
Expand All @@ -34,10 +34,11 @@
# This is a placeholder added due to low code coverage issue
describe '#mirror' do
it 'mirrors repositories and licenses' do
expect(base).to receive(:mirror_implementation)
expect(base).to receive(:cleanup_temp_dirs)
base.mirror
expect(base).to receive(:mirror_implementation)
expect(base).to receive(:cleanup_temp_dirs)
base.mirror
end

it 'throws an exception if mirroring fails' do
allow(base).to receive(:mirror_implementation).and_raise(RMT::Mirror::Exception)
expect(base).to receive(:cleanup_temp_dirs)
Expand All @@ -47,7 +48,7 @@

describe '#mirror_implementation' do
it 'will implement the main mirroring logic' do
expect {base.mirror_implementation}.to raise_error('Not implemented!')
expect { base.mirror_implementation }.to raise_error('Not implemented!')
end
end

Expand Down Expand Up @@ -162,8 +163,9 @@

context 'the signature file is missing' do
let(:response) { Typhoeus::Response.new(code: 404, body: {}) }

it 'creates a log entry' do
expect(downloader).to receive(:download_multi).and_raise(RMT::Downloader::Exception.new('missing file', response: response ))
expect(downloader).to receive(:download_multi).and_raise(RMT::Downloader::Exception.new('missing file', response: response))
expect(logger).to receive(:info).with(/metadata signatures are missing/)
base.check_signature(key_file: key_file, signature_file: signature_file, metadata_file: metadata)
end
Expand All @@ -175,12 +177,11 @@
base.enqueue(base.file_reference('enqueued_file', to: '/test/path/'))
end

it 'should download enqueued contents and clear queue' do
it 'downloads enqueued contents and clear queue' do
expect(downloader).to receive(:download_multi)
base.download_enqueued
expect(base.enqueued).to be_empty
end

end

describe '#replace_directory' do
Expand Down
1 change: 0 additions & 1 deletion spec/lib/rmt/mirror/debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
let(:packages_ref) { RMT::Mirror::FileReference.new(**config) }

describe '#mirror_implementation' do

before do
allow(debian).to receive(:temp).with(:metadata).and_return('bar')
end
Expand Down

0 comments on commit a8ea9c3

Please sign in to comment.