Skip to content

Commit

Permalink
rubocop auto-correct specs
Browse files Browse the repository at this point in the history
  • Loading branch information
aramprice committed Oct 4, 2024
1 parent cba93de commit 85baaf2
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/bosh_aws_cpi/spec/integration/manual_network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
end

retry_options = { sleep: 10, tries: 60, on: RegisteredInstances }
Bosh::Common.retryable(retry_options) do |tries, error|
Bosh::Common.retryable(retry_options) do |_tries, _error|
ensure_no_instances_registered_with_elb(elb_client, @elb_id)
end

Expand Down
2 changes: 1 addition & 1 deletion src/bosh_aws_cpi/spec/unit/block_device_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module Bosh::AwsCloud
context "when creating #{nvme_instance_family} instances" do
let(:instance_type) { "#{nvme_instance_family}.large" }
let(:instance_type_disk_mapping) { BlockDeviceManager::DiskInfo::INSTANCE_TYPE_DISK_MAPPING[instance_type] }
let(:expected_volume_size) { instance_type_disk_mapping && instance_type_disk_mapping[0] || 10 }
let(:expected_volume_size) { (instance_type_disk_mapping && instance_type_disk_mapping[0]) || 10 }

it_behaves_like 'NVMe required instance types'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def if_p(*names)
return ActiveElseBlock.new(self) if value.nil?
value
end
yield *values
yield(*values)
InactiveElseBlock.new
end

Expand Down
4 changes: 2 additions & 2 deletions src/bosh_aws_cpi/spec/unit/create_stemcell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
end

it 'should return stemcell id (not light stemcell id)' do
cloud = mock_cloud do |ec2, client|
cloud = mock_cloud do |ec2, _client|
expect(ec2).to receive(:images).with(
filters: [{
name: 'image-id',
Expand Down Expand Up @@ -130,7 +130,7 @@
end

it 'should encrypt ami with given kms_key_arn' do
cloud = mock_cloud do |ec2, client|
cloud = mock_cloud do |ec2, _client|
expect(ec2).to receive(:images).with(
filters: [{
name: 'image-id',
Expand Down
4 changes: 2 additions & 2 deletions src/bosh_aws_cpi/spec/unit/delete_disk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@

expect do
cloud.delete_disk('v-foo')
end.to raise_error { |error|
end.to(raise_error { |error|
expect(error).to be_a(Bosh::Clouds::DiskNotFound)
expect(error.ok_to_retry).to eq(false)
expect(error.message).to match(/Disk 'v-foo' not found/)
}
})
end
end
2 changes: 1 addition & 1 deletion src/bosh_aws_cpi/spec/unit/get_disks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
it "gets volume ids" do
fake_instance_id = "fakeinstance"

cloud = mock_cloud do |ec2, region|
cloud = mock_cloud do |ec2, _region|
mock_instance = double("AWS Instance")
expect(ec2).to receive(:instance).with(fake_instance_id).and_return(mock_instance)
expect(mock_instance).to receive(:block_device_mappings).and_return([
Expand Down
4 changes: 2 additions & 2 deletions src/bosh_aws_cpi/spec/unit/network_configurator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def set_security_groups(spec, security_groups)
it 'should raise error' do
expect {
Bosh::AwsCloud::NetworkConfigurator.new(network_cloud_props).configure(ec2_resource, instance)
}.to raise_error /No IP provided for vip network 'network1'/
}.to raise_error(/No IP provided for vip network 'network1'/)
end
end

Expand Down Expand Up @@ -159,7 +159,7 @@ def set_security_groups(spec, security_groups)

expect {
Bosh::AwsCloud::NetworkConfigurator.new(network_cloud_props).configure(ec2_resource, instance)
}.to raise_error /Elastic IP with VPC scope not found with address '#{vip_public_ip}'/
}.to raise_error(/Elastic IP with VPC scope not found with address '#{vip_public_ip}'/)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/bosh_aws_cpi/spec/unit/volume_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Bosh::AwsCloud
end

it 'should modify the volume with new size' do
ret = volume_manager.extend_ebs_volume(mock_volume, new_size)
volume_manager.extend_ebs_volume(mock_volume, new_size)

expect(ec2_client).to have_received(:modify_volume).with(volume_id: 1234, size: new_size)
expect(SdkHelpers::VolumeModification).to have_received(:new)
Expand Down

0 comments on commit 85baaf2

Please sign in to comment.