fix rubocop offences and spec tests

This commit is contained in:
Samuel Beaulieu 2022-07-27 09:31:24 -05:00
parent 79516d8014
commit 2a39a8cf06
No known key found for this signature in database
GPG key ID: 12030F74136D0F34
2 changed files with 5 additions and 1 deletions

View file

@ -5,9 +5,10 @@ require 'google/cloud/dns'
module Vmpooler module Vmpooler
class PoolManager class PoolManager
# This class interacts with GCP Cloud DNS to create or delete records.
class CloudDns class CloudDns
def initialize(project, dns_zone_resource_name) def initialize(project, dns_zone_resource_name)
@dns ||= Google::Cloud::Dns.new(project_id: project) @dns = Google::Cloud::Dns.new(project_id: project)
@dns_zone_resource_name = dns_zone_resource_name @dns_zone_resource_name = dns_zone_resource_name
end end

View file

@ -267,6 +267,7 @@ EOT
result = MockResult.new result = MockResult.new
result.status = 'DONE' result.status = 'DONE'
allow(connection).to receive(:insert_instance).and_return(result) allow(connection).to receive(:insert_instance).and_return(result)
allow(subject).to receive(:dns_setup).and_return(true)
end end
it 'should return a hash' do it 'should return a hash' do
@ -313,6 +314,7 @@ EOT
result.status = 'DONE' result.status = 'DONE'
allow(subject).to receive(:wait_for_operation).and_return(result) allow(subject).to receive(:wait_for_operation).and_return(result)
allow(connection).to receive(:delete_instance).and_return(result) allow(connection).to receive(:delete_instance).and_return(result)
allow(subject).to receive(:dns_teardown).and_return(true)
end end
it 'should return true' do it 'should return true' do
@ -584,6 +586,7 @@ EOT
before(:each) do before(:each) do
allow(subject).to receive(:connect_to_gce).and_return(connection) allow(subject).to receive(:connect_to_gce).and_return(connection)
allow(subject).to receive(:dns_teardown).and_return(true)
end end
context 'with empty allowlist' do context 'with empty allowlist' do