From c937d0e258677134994fcee2cb9fef462da83c6e Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Thu, 16 May 2024 12:24:40 +0200 Subject: [PATCH 1/7] Introduce VPC Peering resource VPC Peerings is a closed beta feature and not available for public use. --- README.md | 14 +++ lib/droplet_kit.rb | 3 + .../mappings/vpc_peering_mapping.rb | 30 +++++ lib/droplet_kit/models/vpc_peering.rb | 11 ++ .../resources/vpc_peering_resource.rb | 49 ++++++++ spec/fixtures/vpc_peerings/all.json | 29 +++++ spec/fixtures/vpc_peerings/find.json | 10 ++ .../resources/vpc_peering_resource_spec.rb | 118 ++++++++++++++++++ 8 files changed, 264 insertions(+) create mode 100644 lib/droplet_kit/mappings/vpc_peering_mapping.rb create mode 100644 lib/droplet_kit/models/vpc_peering.rb create mode 100644 lib/droplet_kit/resources/vpc_peering_resource.rb create mode 100644 spec/fixtures/vpc_peerings/all.json create mode 100644 spec/fixtures/vpc_peerings/find.json create mode 100644 spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb diff --git a/README.md b/README.md index 689c0167..6ad3e9f3 100644 --- a/README.md +++ b/README.md @@ -622,6 +622,20 @@ Actions supported: * `client.vpcs.delete(id: 'id')` * `client.vpcs.all_members(id: 'id')` +## VPC Peering resource + + client = DropletKit::Client.new(access_token: 'TOKEN') + client.vpc_peerings #=> DropletKit::VPCPeeringResource + +Actions supported: + +* `client.vpc_peerings.find(id: 'id')` +* `client.vpc_peerings.all()` +* `client.vpc_peerings.create(vpc)` +* `client.vpc_peerings.update(vpc, id: 'id')` +* `client.vpc_peerings.patch(vpc, id: 'id')` +* `client.vpc_peerings.delete(id: 'id')` + ## Container Registry resource client = DropletKit::Client.new(access_token: 'TOKEN') diff --git a/lib/droplet_kit.rb b/lib/droplet_kit.rb index 792a1933..e4e7ff99 100644 --- a/lib/droplet_kit.rb +++ b/lib/droplet_kit.rb @@ -69,6 +69,7 @@ module DropletKit autoload :KubernetesOptions, 'droplet_kit/models/kubernetes_options' autoload :VPC, 'droplet_kit/models/vpc' autoload :VPCMember, 'droplet_kit/models/vpc_member' + autoload :VPCPeering, 'droplet_kit/models/vpc_peering' # Resources autoload :DropletResource, 'droplet_kit/resources/droplet_resource' @@ -104,6 +105,7 @@ module DropletKit autoload :KubernetesClusterResource, 'droplet_kit/resources/kubernetes_cluster_resource' autoload :KubernetesOptionsResource, 'droplet_kit/resources/kubernetes_options_resource' autoload :VPCResource, 'droplet_kit/resources/vpc_resource' + autoload :VPCPeeringResource, 'droplet_kit/resources/vpc_peering_resource' # JSON Maps autoload :DropletMapping, 'droplet_kit/mappings/droplet_mapping' @@ -168,6 +170,7 @@ module DropletKit autoload :KubernetesOptionsMapping, 'droplet_kit/mappings/kubernetes_options_mapping' autoload :VPCMapping, 'droplet_kit/mappings/vpc_mapping' autoload :VPCMemberMapping, 'droplet_kit/mappings/vpc_member_mapping' + autoload :VPCPeeringMapping, 'droplet_kit/mappings/vpc_peering_mapping' # Utils autoload :PaginatedResource, 'droplet_kit/paginated_resource' diff --git a/lib/droplet_kit/mappings/vpc_peering_mapping.rb b/lib/droplet_kit/mappings/vpc_peering_mapping.rb new file mode 100644 index 00000000..e9d39d94 --- /dev/null +++ b/lib/droplet_kit/mappings/vpc_peering_mapping.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module DropletKit + class VPCPeeringMapping + include Kartograph::DSL + + kartograph do + mapping VPCPeering + root_key plural: 'vpc_peerings', singular: 'vpc_peering', scopes: [:read] + + scoped :read do + property :id + property :name + property :vpc_ids + property :created_at + property :status + end + + scoped :update, :patch do + property :name + end + + scoped :create do + property :name + property :vpc_ids + end + end + end +end + diff --git a/lib/droplet_kit/models/vpc_peering.rb b/lib/droplet_kit/models/vpc_peering.rb new file mode 100644 index 00000000..b7858f55 --- /dev/null +++ b/lib/droplet_kit/models/vpc_peering.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module DropletKit + class VPCPeering < BaseModel + attribute :id + attribute :name + attribute :vpc_ids + attribute :created_at + attribute :status + end +end diff --git a/lib/droplet_kit/resources/vpc_peering_resource.rb b/lib/droplet_kit/resources/vpc_peering_resource.rb new file mode 100644 index 00000000..27ec4d64 --- /dev/null +++ b/lib/droplet_kit/resources/vpc_peering_resource.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module DropletKit + class VPCPeeringResource < ResourceKit::Resource + include ErrorHandlingResourcable + + resources do + action :find, 'GET /v2/vpc_peerings/:id' do + handler(200) do |response| + VPCPeeringMapping.extract_single(response.body, :read) + end + end + + action :all, 'GET /v2/vpc_peerings' do + query_keys :per_page, :page + + handler(200) do |response| + VPCPeeringMapping.extract_collection(response.body, :read) + end + end + + action :create, 'POST /v2/vpc_peerings' do + body { |vpc| VPCPeeringMapping.representation_for(:create, vpc) } + handler(201) { |response| VPCPeeringMapping.extract_single(response.body, :read) } + handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) } + end + + action :update, 'PUT /v2/vpc_peerings/:id' do + body { |vpc| VPCPeeringMapping.representation_for(:update, vpc) } + handler(200) { |response| VPCPeeringMapping.extract_single(response.body, :read) } + handler(422) { |response| ErrorMapping.fail_with(FailedUpdate, response.body) } + end + + action :patch, 'PATCH /v2/vpc_peerings/:id' do + body { |vpc| VPCPeeringMapping.representation_for(:patch, vpc) } + handler(200) { |response| VPCPeeringMapping.extract_single(response.body, :read) } + handler(422) { |response| ErrorMapping.fail_with(FailedUpdate, response.body) } + end + + action :delete, 'DELETE /v2/vpc_peerings/:id' do + handler(204) { |_| true } + end + end + + def all(*args) + PaginatedResource.new(action(:all), self, *args) + end + end +end diff --git a/spec/fixtures/vpc_peerings/all.json b/spec/fixtures/vpc_peerings/all.json new file mode 100644 index 00000000..e83bfcf0 --- /dev/null +++ b/spec/fixtures/vpc_peerings/all.json @@ -0,0 +1,29 @@ +{ + "vpc_peerings": [ + { + "id":"6e9bff8e-2d65-4301-9a48-f80a25ad89fa", + "name":"my-new-vpc-peering-1", + "vpc_ids":["880b7f98-f062-404d-b33c-458d545696f6","be76c5b4-c6c4-4fbb-a710-edbfe76c1982"], + "created_at":"2024-04-03T21:48:41.995304079Z", + "status":"ACTIVE" + }, + { + "id":"cea63fe9-d95a-4bf9-b1ad-a599c67dec73", + "name":"my-new-vpc-peering-1", + "vpc_ids":["4598983b-e0f4-4039-ac6e-07e487e2712b","d4b88c23-528b-462d-8433-8740398a46cf"], + "created_at":"2024-04-03T21:48:45.995304079Z", + "status":"ACTIVE" + } + ], + "links": { + "pages": { + "first": "https://api.digitalocean.com/v2/vpc_peerings?page=1&per_page=2", + "last": "https://api.digitalocean.com/v2/vpc_peerings?page=4&per_page=2", + "next": "https://api.digitalocean.com/v2/vpc_peerings?page=3&per_page=2", + "prev": "https://api.digitalocean.com/v2/vpc_peerings?page=1&per_page=2" + } + }, + "meta": { + "total": 10 + } +} diff --git a/spec/fixtures/vpc_peerings/find.json b/spec/fixtures/vpc_peerings/find.json new file mode 100644 index 00000000..52b37ab2 --- /dev/null +++ b/spec/fixtures/vpc_peerings/find.json @@ -0,0 +1,10 @@ +{ + "vpc_peering": + { + "id":"6e9bff8e-2d65-4301-9a48-f80a25ad89fa", + "name":"my-new-vpc-peering-1", + "vpc_ids":["880b7f98-f062-404d-b33c-458d545696f6","be76c5b4-c6c4-4fbb-a710-edbfe76c1982"], + "created_at":"2024-04-03T21:48:41.995304079Z", + "status":"ACTIVE" + } +} diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb new file mode 100644 index 00000000..37c66ffc --- /dev/null +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe DropletKit::VPCPeeringResource do + subject(:resource) { described_class.new(connection: connection) } + + include_context 'resources' + + let(:vpc_peering_fixture_path) { 'vpc_peerings/find' } + let(:base_path) { '/v2/vpc_peerings' } + let(:vpc_peering_uuid) { '880b7f98-f062-404d-b33c-458d545696f6' } + + RSpec::Matchers.define :match_vpc_peering_fixture do + match do |vpc_peering| + expect(vpc_peering.id).to eq('6e9bff8e-2d65-4301-9a48-f80a25ad89fa') + expect(vpc_peering.name).to eq('my-new-vpc-peering-1') + expect(vpc_peering.vpc_ids).to eq(["880b7f98-f062-404d-b33c-458d545696f6","be76c5b4-c6c4-4fbb-a710-edbfe76c1982"]) + expect(vpc_peering.created_at).to eq('2024-04-03T21:48:41.995304079Z') + expect(vpc_peering.status).to eq('ACTIVE') + end + end + + describe '#find' do + it 'returns vpc peering' do + stub_do_api(File.join(base_path, vpc_peering_uuid), :get).to_return(body: api_fixture(vpc_peering_fixture_path)) + vpc_peering = resource.find(id: vpc_peering_uuid) + + expect(vpc_peering).to match_vpc_peering_fixture + end + end + + describe '#all' do + let(:vpcs_fixture_path) { 'vpc_peerings/all' } + + it 'returns all of the vpc peerings' do + stub_do_api(base_path, :get).to_return(body: api_fixture(vpcs_fixture_path)) + vpcs = resource.all + + expect(vpcs).to all(be_a(DropletKit::VPCPeering)) + expect(vpcs.first).to match_vpc_peering_fixture + end + + it_behaves_like 'a paginated index' do + let(:fixture_path) { vpcs_fixture_path } + let(:api_path) { base_path } + end + end + + context 'create, update and patch' do + let(:vpc_peering) do + DropletKit::VPCPeering.new( + name: 'example-vpc-peering' + ) + end + + describe '#create' do + let(:path) { base_path } + + it 'returns created vpc peering' do + json_body = DropletKit::VPCPeeringMapping.representation_for(:create, vpc_peering) + stub_do_api(path, :post).with(body: json_body).to_return(body: api_fixture(vpc_peering_fixture_path), status: 201) + + expect(resource.create(vpc_peering)).to match_vpc_peering_fixture + end + + it_behaves_like 'an action that handles invalid parameters' do + let(:action) { 'create' } + let(:arguments) { DropletKit::VPCPeering.new } + end + end + + describe '#update' do + let(:path) { base_path } + + it 'returns updated vpc peering' do + json_body = DropletKit::VPCPeeringMapping.representation_for(:update, vpc_peering) + stub_do_api(File.join(base_path, vpc_peering_uuid), :put).with(body: json_body).to_return(body: api_fixture(vpc_peering_fixture_path), status: 200) + + expect(resource.update(vpc_peering, id: vpc_peering_uuid)).to match_vpc_peering_fixture + end + + it_behaves_like 'an action that handles invalid parameters' do + let(:verb) { :put } + let(:exception) { DropletKit::FailedUpdate } + let(:action) { 'update' } + let(:arguments) { DropletKit::VPCPeering.new } + end + end + + describe '#patch' do + let(:path) { base_path } + + it 'returns patched vpc peering' do + json_body = DropletKit::VPCPeeringMapping.representation_for(:patch, vpc_peering) + stub_do_api(File.join(base_path, vpc_peering_uuid), :patch).with(body: json_body).to_return(body: api_fixture(vpc_peering_fixture_path), status: 200) + + expect(resource.patch(vpc_peering, id: vpc_peering_uuid)).to match_vpc_peering_fixture + end + + it_behaves_like 'an action that handles invalid parameters' do + let(:verb) { :patch } + let(:exception) { DropletKit::FailedUpdate } + let(:action) { 'patch' } + let(:arguments) { DropletKit::VPCPeering.new } + end + end + end + + describe '#delete' do + it 'sends a delete request for the vpc' do + request = stub_do_api(File.join(base_path, vpc_peering_uuid), :delete) + resource.delete(id: vpc_peering_uuid) + + expect(request).to have_been_made + end + end +end From 67a2c0812896615a3664e3bb2c562c06de1b2a31 Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Thu, 16 May 2024 12:40:54 +0200 Subject: [PATCH 2/7] Fix linter --- lib/droplet_kit/mappings/vpc_peering_mapping.rb | 1 - spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/droplet_kit/mappings/vpc_peering_mapping.rb b/lib/droplet_kit/mappings/vpc_peering_mapping.rb index e9d39d94..f4e92a5a 100644 --- a/lib/droplet_kit/mappings/vpc_peering_mapping.rb +++ b/lib/droplet_kit/mappings/vpc_peering_mapping.rb @@ -27,4 +27,3 @@ class VPCPeeringMapping end end end - diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb index 37c66ffc..0bb87cfc 100644 --- a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -15,7 +15,7 @@ match do |vpc_peering| expect(vpc_peering.id).to eq('6e9bff8e-2d65-4301-9a48-f80a25ad89fa') expect(vpc_peering.name).to eq('my-new-vpc-peering-1') - expect(vpc_peering.vpc_ids).to eq(["880b7f98-f062-404d-b33c-458d545696f6","be76c5b4-c6c4-4fbb-a710-edbfe76c1982"]) + expect(vpc_peering.vpc_ids).to eq(%w[880b7f98-f062-404d-b33c-458d545696f6 be76c5b4-c6c4-4fbb-a710-edbfe76c1982]) expect(vpc_peering.created_at).to eq('2024-04-03T21:48:41.995304079Z') expect(vpc_peering.status).to eq('ACTIVE') end @@ -47,7 +47,7 @@ end end - context 'create, update and patch' do + context 'when creating, updating and patching' do let(:vpc_peering) do DropletKit::VPCPeering.new( name: 'example-vpc-peering' From cf86a1c1ab27dd848738a69cdc3ad3349c95bebc Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Thu, 16 May 2024 15:11:04 +0200 Subject: [PATCH 3/7] Fix vpc peering return codes --- lib/droplet_kit/resources/vpc_peering_resource.rb | 4 ++-- spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/droplet_kit/resources/vpc_peering_resource.rb b/lib/droplet_kit/resources/vpc_peering_resource.rb index 27ec4d64..81a09b7d 100644 --- a/lib/droplet_kit/resources/vpc_peering_resource.rb +++ b/lib/droplet_kit/resources/vpc_peering_resource.rb @@ -21,7 +21,7 @@ class VPCPeeringResource < ResourceKit::Resource action :create, 'POST /v2/vpc_peerings' do body { |vpc| VPCPeeringMapping.representation_for(:create, vpc) } - handler(201) { |response| VPCPeeringMapping.extract_single(response.body, :read) } + handler(202) { |response| VPCPeeringMapping.extract_single(response.body, :read) } handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) } end @@ -38,7 +38,7 @@ class VPCPeeringResource < ResourceKit::Resource end action :delete, 'DELETE /v2/vpc_peerings/:id' do - handler(204) { |_| true } + handler(202) { |_| true } end end diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb index 0bb87cfc..e077bcf2 100644 --- a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -59,7 +59,7 @@ it 'returns created vpc peering' do json_body = DropletKit::VPCPeeringMapping.representation_for(:create, vpc_peering) - stub_do_api(path, :post).with(body: json_body).to_return(body: api_fixture(vpc_peering_fixture_path), status: 201) + stub_do_api(path, :post).with(body: json_body).to_return(body: api_fixture(vpc_peering_fixture_path), status: 202) expect(resource.create(vpc_peering)).to match_vpc_peering_fixture end From bbb01b49ffe1e67df3d3401cd702eee9f10afdb9 Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Thu, 16 May 2024 15:22:22 +0200 Subject: [PATCH 4/7] Return vpc peering when deleting --- lib/droplet_kit/resources/vpc_peering_resource.rb | 2 +- .../resources/vpc_peering_resource_spec.rb | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/droplet_kit/resources/vpc_peering_resource.rb b/lib/droplet_kit/resources/vpc_peering_resource.rb index 81a09b7d..d92651b0 100644 --- a/lib/droplet_kit/resources/vpc_peering_resource.rb +++ b/lib/droplet_kit/resources/vpc_peering_resource.rb @@ -38,7 +38,7 @@ class VPCPeeringResource < ResourceKit::Resource end action :delete, 'DELETE /v2/vpc_peerings/:id' do - handler(202) { |_| true } + handler(202) { |response| VPCPeeringMapping.extract_single(response.body, :read) } end end diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb index e077bcf2..16662aff 100644 --- a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -47,7 +47,7 @@ end end - context 'when creating, updating and patching' do + context 'when creating, updating, patching, and deleting' do let(:vpc_peering) do DropletKit::VPCPeering.new( name: 'example-vpc-peering' @@ -105,14 +105,15 @@ let(:arguments) { DropletKit::VPCPeering.new } end end - end - describe '#delete' do - it 'sends a delete request for the vpc' do - request = stub_do_api(File.join(base_path, vpc_peering_uuid), :delete) - resource.delete(id: vpc_peering_uuid) + describe '#delete' do + let(:path) { base_path } + + it 'returns vpc peering pending deletion' do + stub_do_api(File.join(base_path, vpc_peering_uuid), :delete).to_return(body: api_fixture(vpc_peering_fixture_path), status: 202) - expect(request).to have_been_made + expect(resource.delete(id: vpc_peering_uuid)).to match_vpc_peering_fixture + end end end end From 82dbf32ea075b99de78ee0fb0e6b2ca8d0e500a8 Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Thu, 16 May 2024 16:01:40 +0200 Subject: [PATCH 5/7] Remove PUT /vpc_peerings --- README.md | 6 +++--- lib/droplet_kit/client.rb | 3 ++- .../resources/vpc_peering_resource.rb | 10 ++-------- .../resources/vpc_peering_resource_spec.rb | 20 +------------------ 4 files changed, 8 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 6ad3e9f3..83c653f0 100644 --- a/README.md +++ b/README.md @@ -631,9 +631,9 @@ Actions supported: * `client.vpc_peerings.find(id: 'id')` * `client.vpc_peerings.all()` -* `client.vpc_peerings.create(vpc)` -* `client.vpc_peerings.update(vpc, id: 'id')` -* `client.vpc_peerings.patch(vpc, id: 'id')` +* `client.vpc_peerings.create(vpc_peering)` +* `client.vpc_peerings.update(vpc_peering, id: 'id')` +* `client.vpc_peerings.patch(vpc_peering, id: 'id')` * `client.vpc_peerings.delete(id: 'id')` ## Container Registry resource diff --git a/lib/droplet_kit/client.rb b/lib/droplet_kit/client.rb index 9756218f..49a8989d 100644 --- a/lib/droplet_kit/client.rb +++ b/lib/droplet_kit/client.rb @@ -80,7 +80,8 @@ def self.resources projects: ProjectResource, volumes: VolumeResource, volume_actions: VolumeActionResource, - vpcs: VPCResource + vpcs: VPCResource, + vpc_peerings: VPCPeeringResource } end diff --git a/lib/droplet_kit/resources/vpc_peering_resource.rb b/lib/droplet_kit/resources/vpc_peering_resource.rb index d92651b0..6c3fadef 100644 --- a/lib/droplet_kit/resources/vpc_peering_resource.rb +++ b/lib/droplet_kit/resources/vpc_peering_resource.rb @@ -20,19 +20,13 @@ class VPCPeeringResource < ResourceKit::Resource end action :create, 'POST /v2/vpc_peerings' do - body { |vpc| VPCPeeringMapping.representation_for(:create, vpc) } + body { |vpc_peering| VPCPeeringMapping.representation_for(:create, vpc_peering) } handler(202) { |response| VPCPeeringMapping.extract_single(response.body, :read) } handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) } end - action :update, 'PUT /v2/vpc_peerings/:id' do - body { |vpc| VPCPeeringMapping.representation_for(:update, vpc) } - handler(200) { |response| VPCPeeringMapping.extract_single(response.body, :read) } - handler(422) { |response| ErrorMapping.fail_with(FailedUpdate, response.body) } - end - action :patch, 'PATCH /v2/vpc_peerings/:id' do - body { |vpc| VPCPeeringMapping.representation_for(:patch, vpc) } + body { |vpc_peering| VPCPeeringMapping.representation_for(:patch, vpc_peering) } handler(200) { |response| VPCPeeringMapping.extract_single(response.body, :read) } handler(422) { |response| ErrorMapping.fail_with(FailedUpdate, response.body) } end diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb index 16662aff..9a716e07 100644 --- a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -47,7 +47,7 @@ end end - context 'when creating, updating, patching, and deleting' do + context 'when creating, patching, and deleting' do let(:vpc_peering) do DropletKit::VPCPeering.new( name: 'example-vpc-peering' @@ -70,24 +70,6 @@ end end - describe '#update' do - let(:path) { base_path } - - it 'returns updated vpc peering' do - json_body = DropletKit::VPCPeeringMapping.representation_for(:update, vpc_peering) - stub_do_api(File.join(base_path, vpc_peering_uuid), :put).with(body: json_body).to_return(body: api_fixture(vpc_peering_fixture_path), status: 200) - - expect(resource.update(vpc_peering, id: vpc_peering_uuid)).to match_vpc_peering_fixture - end - - it_behaves_like 'an action that handles invalid parameters' do - let(:verb) { :put } - let(:exception) { DropletKit::FailedUpdate } - let(:action) { 'update' } - let(:arguments) { DropletKit::VPCPeering.new } - end - end - describe '#patch' do let(:path) { base_path } From 448e99f917d52695b2909f102f07b64337a7d57d Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Thu, 16 May 2024 16:28:28 +0200 Subject: [PATCH 6/7] Adapt rubocop --- .rubocop_todo.yml | 2 +- lib/droplet_kit/resources/droplet_action_resource.rb | 2 +- spec/lib/droplet_kit/models/base_model_spec.rb | 2 +- spec/lib/droplet_kit/models/droplet_spec.rb | 2 +- spec/lib/droplet_kit/models/loadbalancer_spec.rb | 2 +- spec/lib/droplet_kit/resources/account_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/action_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/balance_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/cdn_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/certificate_resource_spec.rb | 2 +- .../resources/container_registry_repository_resource_spec.rb | 2 +- .../droplet_kit/resources/container_registry_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/database_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/domain_record_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/domain_resource_spec.rb | 2 +- .../lib/droplet_kit/resources/droplet_action_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/droplet_resource_spec.rb | 4 ++-- .../droplet_kit/resources/droplet_upgrade_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/firewall_resource_spec.rb | 2 +- .../droplet_kit/resources/floating_ip_action_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/image_action_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/image_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/invoice_resource_spec.rb | 2 +- .../droplet_kit/resources/kubernetes_cluster_resource_spec.rb | 2 +- .../droplet_kit/resources/kubernetes_options_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/project_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/region_resource_spec.rb | 2 +- .../droplet_kit/resources/reserved_ip_action_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/size_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/snapshot_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/tag_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/volume_action_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/volume_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb | 2 +- spec/lib/droplet_kit/resources/vpc_resource_spec.rb | 2 +- 39 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5f46c328..169df909 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -74,7 +74,7 @@ Metrics/MethodLength: # Offense count: 1 # Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 164 + Max: 167 # Offense count: 1 # Configuration parameters: EnforcedStyleForLeadingUnderscores. diff --git a/lib/droplet_kit/resources/droplet_action_resource.rb b/lib/droplet_kit/resources/droplet_action_resource.rb index f5235436..8c7e67bd 100644 --- a/lib/droplet_kit/resources/droplet_action_resource.rb +++ b/lib/droplet_kit/resources/droplet_action_resource.rb @@ -35,7 +35,7 @@ class DropletActionResource < ResourceKit::Resource end TAG_ACTIONS.each do |action_name| - action "#{action_name}_for_tag".to_sym, 'POST /v2/droplets/actions' do + action :"#{action_name}_for_tag", 'POST /v2/droplets/actions' do query_keys :tag_name body { |_| { type: action_name }.to_json } handler(201, 200) { |response| ActionMapping.extract_collection(response.body, :read) } diff --git a/spec/lib/droplet_kit/models/base_model_spec.rb b/spec/lib/droplet_kit/models/base_model_spec.rb index d3ec50a4..0f4299e4 100644 --- a/spec/lib/droplet_kit/models/base_model_spec.rb +++ b/spec/lib/droplet_kit/models/base_model_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::BaseModel do +RSpec.describe DropletKit::BaseModel do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) do Class.new(DropletKit::BaseModel) do |base| attribute :droplet_limit diff --git a/spec/lib/droplet_kit/models/droplet_spec.rb b/spec/lib/droplet_kit/models/droplet_spec.rb index 8497aa8f..5e79e4d1 100644 --- a/spec/lib/droplet_kit/models/droplet_spec.rb +++ b/spec/lib/droplet_kit/models/droplet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::Droplet do +RSpec.describe DropletKit::Droplet do # rubocop:todo RSpec/SpecFilePathFormat let(:droplet_fixture) { api_fixture('droplets/find') } let(:droplet) { DropletKit::DropletMapping.extract_single(droplet_fixture, :read) } diff --git a/spec/lib/droplet_kit/models/loadbalancer_spec.rb b/spec/lib/droplet_kit/models/loadbalancer_spec.rb index 7e92648b..f535bfa2 100644 --- a/spec/lib/droplet_kit/models/loadbalancer_spec.rb +++ b/spec/lib/droplet_kit/models/loadbalancer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::LoadBalancer do +RSpec.describe DropletKit::LoadBalancer do # rubocop:todo RSpec/SpecFilePathFormat let(:lb) { described_class.new(sticky_sessions: { cookie_ttl_seconds: '500' }) } describe 'redirect_http_to_https' do diff --git a/spec/lib/droplet_kit/resources/account_resource_spec.rb b/spec/lib/droplet_kit/resources/account_resource_spec.rb index 993be108..53ec397f 100644 --- a/spec/lib/droplet_kit/resources/account_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/account_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::AccountResource do +RSpec.describe DropletKit::AccountResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/action_resource_spec.rb b/spec/lib/droplet_kit/resources/action_resource_spec.rb index 5c57e31d..f5b60c8b 100644 --- a/spec/lib/droplet_kit/resources/action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ActionResource do +RSpec.describe DropletKit::ActionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/balance_resource_spec.rb b/spec/lib/droplet_kit/resources/balance_resource_spec.rb index 21e3cefa..b4eacbd3 100644 --- a/spec/lib/droplet_kit/resources/balance_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/balance_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::BalanceResource do +RSpec.describe DropletKit::BalanceResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/cdn_resource_spec.rb b/spec/lib/droplet_kit/resources/cdn_resource_spec.rb index 08ac32fe..0f22140c 100644 --- a/spec/lib/droplet_kit/resources/cdn_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/cdn_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::CDNResource do +RSpec.describe DropletKit::CDNResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/certificate_resource_spec.rb b/spec/lib/droplet_kit/resources/certificate_resource_spec.rb index 757c58ce..7e5cd76d 100644 --- a/spec/lib/droplet_kit/resources/certificate_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/certificate_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::CertificateResource do +RSpec.describe DropletKit::CertificateResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb b/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb index a4a3f5e4..8db4dc19 100644 --- a/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ContainerRegistryRepositoryResource do +RSpec.describe DropletKit::ContainerRegistryRepositoryResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb b/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb index 6c8f939f..c5674a31 100644 --- a/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ContainerRegistryResource do +RSpec.describe DropletKit::ContainerRegistryResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/database_resource_spec.rb b/spec/lib/droplet_kit/resources/database_resource_spec.rb index 2e3b8a24..bed7ce82 100644 --- a/spec/lib/droplet_kit/resources/database_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/database_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DatabaseResource do +RSpec.describe DropletKit::DatabaseResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } let(:database_cluster_id) { '9cc10173-e9ea-4176-9dbc-a4cee4c4ff30' } diff --git a/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb b/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb index 3adc5cc0..fc9c91ab 100644 --- a/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DomainRecordResource do +RSpec.describe DropletKit::DomainRecordResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/domain_resource_spec.rb b/spec/lib/droplet_kit/resources/domain_resource_spec.rb index 49f6e85a..12561120 100644 --- a/spec/lib/droplet_kit/resources/domain_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/domain_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DomainResource do +RSpec.describe DropletKit::DomainResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb b/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb index d0aaf6a9..cb1dc89e 100644 --- a/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DropletActionResource do +RSpec.describe DropletKit::DropletActionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } let(:droplet_id) { 1066 } diff --git a/spec/lib/droplet_kit/resources/droplet_resource_spec.rb b/spec/lib/droplet_kit/resources/droplet_resource_spec.rb index 3c6a756a..dacb8413 100644 --- a/spec/lib/droplet_kit/resources/droplet_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/droplet_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DropletResource do +RSpec.describe DropletKit::DropletResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' @@ -19,7 +19,7 @@ def check_droplet(droplet, tags = [], overrides = {}) status: 'active' }.merge(overrides) - attrs.each do |attr, val| + attrs.each_key do |attr| expect(droplet.send(attr)).to eq attrs[attr] end diff --git a/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb b/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb index c7b24397..43d9f51c 100644 --- a/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DropletUpgradeResource do +RSpec.describe DropletKit::DropletUpgradeResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/firewall_resource_spec.rb b/spec/lib/droplet_kit/resources/firewall_resource_spec.rb index 14de6394..87790239 100644 --- a/spec/lib/droplet_kit/resources/firewall_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/firewall_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::FirewallResource do +RSpec.describe DropletKit::FirewallResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb b/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb index 7fbeeb75..10827776 100644 --- a/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::FloatingIpActionResource do +RSpec.describe DropletKit::FloatingIpActionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb b/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb index 92c894bf..0354783b 100644 --- a/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::FloatingIpResource do +RSpec.describe DropletKit::FloatingIpResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/image_action_resource_spec.rb b/spec/lib/droplet_kit/resources/image_action_resource_spec.rb index 44617097..ecb659ad 100644 --- a/spec/lib/droplet_kit/resources/image_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/image_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ImageActionResource do +RSpec.describe DropletKit::ImageActionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/image_resource_spec.rb b/spec/lib/droplet_kit/resources/image_resource_spec.rb index 719602c9..fb863107 100644 --- a/spec/lib/droplet_kit/resources/image_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/image_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ImageResource do +RSpec.describe DropletKit::ImageResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/invoice_resource_spec.rb b/spec/lib/droplet_kit/resources/invoice_resource_spec.rb index 6152dfb8..c504aaaa 100644 --- a/spec/lib/droplet_kit/resources/invoice_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/invoice_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::InvoiceResource do +RSpec.describe DropletKit::InvoiceResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb b/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb index d3a1e658..6c66c040 100644 --- a/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::KubernetesClusterResource do +RSpec.describe DropletKit::KubernetesClusterResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } let(:kubernetes_node_pool_attributes) { DropletKit::KubernetesNodePool.new.attributes } diff --git a/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb b/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb index 46aab19f..5a265136 100644 --- a/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::KubernetesOptionsResource do +RSpec.describe DropletKit::KubernetesOptionsResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb b/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb index faa4f37f..21da26d5 100644 --- a/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::LoadBalancerResource do +RSpec.describe DropletKit::LoadBalancerResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/project_resource_spec.rb b/spec/lib/droplet_kit/resources/project_resource_spec.rb index 8ded22c2..d80a8a17 100644 --- a/spec/lib/droplet_kit/resources/project_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/project_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DropletKit::ProjectResource do +describe DropletKit::ProjectResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/region_resource_spec.rb b/spec/lib/droplet_kit/resources/region_resource_spec.rb index 337ccedf..406ef05b 100644 --- a/spec/lib/droplet_kit/resources/region_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/region_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::RegionResource do +RSpec.describe DropletKit::RegionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb b/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb index 6369c00a..4a2486ae 100644 --- a/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ReservedIpActionResource do +RSpec.describe DropletKit::ReservedIpActionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb b/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb index c05b7d4b..52ca46fe 100644 --- a/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ReservedIpResource do +RSpec.describe DropletKit::ReservedIpResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/size_resource_spec.rb b/spec/lib/droplet_kit/resources/size_resource_spec.rb index 13571f4c..b34beee4 100644 --- a/spec/lib/droplet_kit/resources/size_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/size_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::SizeResource do +RSpec.describe DropletKit::SizeResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb b/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb index 3f37ab61..4ffce1cc 100644 --- a/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::SnapshotResource do +RSpec.describe DropletKit::SnapshotResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb b/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb index df9342f0..6a9c306b 100644 --- a/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::SSHKeyResource do +RSpec.describe DropletKit::SSHKeyResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/tag_resource_spec.rb b/spec/lib/droplet_kit/resources/tag_resource_spec.rb index 3720000b..c229b1cc 100644 --- a/spec/lib/droplet_kit/resources/tag_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/tag_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DropletKit::TagResource do +describe DropletKit::TagResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb b/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb index e6555f3a..ee334819 100644 --- a/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VolumeActionResource do +RSpec.describe DropletKit::VolumeActionResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/volume_resource_spec.rb b/spec/lib/droplet_kit/resources/volume_resource_spec.rb index 9c1ede0c..31e899a6 100644 --- a/spec/lib/droplet_kit/resources/volume_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/volume_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VolumeResource do +RSpec.describe DropletKit::VolumeResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb index 9a716e07..14a4243f 100644 --- a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VPCPeeringResource do +RSpec.describe DropletKit::VPCPeeringResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/vpc_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_resource_spec.rb index 45d03306..96328cbd 100644 --- a/spec/lib/droplet_kit/resources/vpc_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VPCResource do +RSpec.describe DropletKit::VPCResource do # rubocop:todo RSpec/SpecFilePathFormat subject(:resource) { described_class.new(connection: connection) } include_context 'resources' From d5ee3f38af88f0b5be06850364a23da0b3266451 Mon Sep 17 00:00:00 2001 From: Bruno Grasselli Date: Fri, 17 May 2024 10:19:55 +0200 Subject: [PATCH 7/7] Update .rubocop_todo.yml --- .rubocop_todo.yml | 53 ++++++++++--------- .../lib/droplet_kit/models/base_model_spec.rb | 2 +- spec/lib/droplet_kit/models/droplet_spec.rb | 2 +- .../droplet_kit/models/loadbalancer_spec.rb | 2 +- .../resources/account_resource_spec.rb | 2 +- .../resources/action_resource_spec.rb | 2 +- .../resources/balance_resource_spec.rb | 2 +- .../resources/cdn_resource_spec.rb | 2 +- .../resources/certificate_resource_spec.rb | 2 +- ...ainer_registry_repository_resource_spec.rb | 2 +- .../container_registry_resource_spec.rb | 2 +- .../resources/database_resource_spec.rb | 2 +- .../resources/domain_record_resource_spec.rb | 2 +- .../resources/domain_resource_spec.rb | 2 +- .../resources/droplet_action_resource_spec.rb | 2 +- .../resources/droplet_resource_spec.rb | 2 +- .../droplet_upgrade_resource_spec.rb | 2 +- .../resources/firewall_resource_spec.rb | 2 +- .../floating_ip_action_resource_spec.rb | 2 +- .../resources/floating_ip_resource_spec.rb | 2 +- .../resources/image_action_resource_spec.rb | 2 +- .../resources/image_resource_spec.rb | 2 +- .../resources/invoice_resource_spec.rb | 2 +- .../kubernetes_cluster_resource_spec.rb | 2 +- .../kubernetes_options_resource_spec.rb | 2 +- .../resources/load_balancer_resource_spec.rb | 2 +- .../resources/project_resource_spec.rb | 2 +- .../resources/region_resource_spec.rb | 2 +- .../reserved_ip_action_resource_spec.rb | 2 +- .../resources/reserved_ip_resource_spec.rb | 2 +- .../resources/size_resource_spec.rb | 2 +- .../resources/snapshot_resource_spec.rb | 2 +- .../resources/ssh_key_resource_spec.rb | 2 +- .../resources/tag_resource_spec.rb | 2 +- .../resources/volume_action_resource_spec.rb | 2 +- .../resources/volume_resource_spec.rb | 2 +- .../resources/vpc_peering_resource_spec.rb | 2 +- .../resources/vpc_resource_spec.rb | 2 +- 38 files changed, 66 insertions(+), 61 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 169df909..c1160010 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2022-06-23 17:10:56 UTC using RuboCop version 1.30.1. +# on 2024-05-17 08:19:08 UTC using RuboCop version 1.63.5. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -27,37 +27,33 @@ Lint/StructNewOverride: - 'lib/droplet_kit/models/pagination_information.rb' - 'spec/lib/droplet_kit/paginated_resource_spec.rb' -# Offense count: 1 -Lint/ToEnumArguments: - Exclude: - - 'lib/droplet_kit/utils.rb' - # Offense count: 1 # Configuration parameters: AllowKeywordBlockArguments. Lint/UnderscorePrefixedVariableName: Exclude: - 'spec/lib/droplet_kit/client_spec.rb' -# Offense count: 36 +# Offense count: 35 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +# Configuration parameters: AutoCorrect, IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Enabled: false # Offense count: 2 -# Configuration parameters: CheckForMethodsWithNoSideEffects. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - 'spec/lib/droplet_kit/paginated_resource_spec.rb' # Offense count: 4 -# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 184 # Offense count: 16 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods, inherit_mode. -# IgnoredMethods: refine +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. +# AllowedMethods: refine Metrics/BlockLength: Max: 127 @@ -66,8 +62,8 @@ Metrics/BlockLength: Metrics/ClassLength: Max: 133 -# Offense count: 4 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# Offense count: 6 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 55 @@ -77,6 +73,7 @@ Metrics/ModuleLength: Max: 167 # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -86,7 +83,7 @@ Naming/MemoizedInstanceVariableName: # Offense count: 14 # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 Naming/VariableNumber: Exclude: - 'spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb' @@ -94,7 +91,7 @@ Naming/VariableNumber: - 'spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb' # Offense count: 33 -# Configuration parameters: Prefixes. +# Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: Exclude: @@ -113,12 +110,12 @@ RSpec/ContextWording: - 'spec/lib/droplet_kit/resources/vpc_resource_spec.rb' - 'spec/support/resource_context.rb' -# Offense count: 114 +# Offense count: 120 # Configuration parameters: CountAsOne. RSpec/ExampleLength: Max: 43 -# Offense count: 36 +# Offense count: 37 # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. # Include: **/*_spec*rb*, **/spec/**/* RSpec/FilePath: @@ -134,7 +131,7 @@ RSpec/LeakyConstantDeclaration: Exclude: - 'spec/lib/droplet_kit/client_spec.rb' -# Offense count: 118 +# Offense count: 122 RSpec/MultipleExpectations: Max: 30 @@ -144,15 +141,23 @@ RSpec/MultipleMemoizedHelpers: Max: 11 # Offense count: 3 +# Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 4 -# Offense count: 58 +# Offense count: 37 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata. +# Include: **/*_spec.rb +RSpec/SpecFilePathFormat: + Enabled: false + +# Offense count: 168 # Configuration parameters: AllowedConstants. Style/Documentation: Enabled: false # Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: Exclude: @@ -165,8 +170,8 @@ Style/MissingRespondToMissing: # Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods, AllowComments. -# IgnoredMethods: respond_to, define_method +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method Style/SymbolProc: Exclude: - 'lib/droplet_kit/resources/container_registry_resource.rb' @@ -174,9 +179,9 @@ Style/SymbolProc: - 'lib/droplet_kit/resources/kubernetes_cluster_resource.rb' - 'lib/tasks/resource_doc.rake' -# Offense count: 86 +# Offense count: 90 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: Max: 221 diff --git a/spec/lib/droplet_kit/models/base_model_spec.rb b/spec/lib/droplet_kit/models/base_model_spec.rb index 0f4299e4..d3ec50a4 100644 --- a/spec/lib/droplet_kit/models/base_model_spec.rb +++ b/spec/lib/droplet_kit/models/base_model_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::BaseModel do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::BaseModel do subject(:resource) do Class.new(DropletKit::BaseModel) do |base| attribute :droplet_limit diff --git a/spec/lib/droplet_kit/models/droplet_spec.rb b/spec/lib/droplet_kit/models/droplet_spec.rb index 5e79e4d1..8497aa8f 100644 --- a/spec/lib/droplet_kit/models/droplet_spec.rb +++ b/spec/lib/droplet_kit/models/droplet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::Droplet do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::Droplet do let(:droplet_fixture) { api_fixture('droplets/find') } let(:droplet) { DropletKit::DropletMapping.extract_single(droplet_fixture, :read) } diff --git a/spec/lib/droplet_kit/models/loadbalancer_spec.rb b/spec/lib/droplet_kit/models/loadbalancer_spec.rb index f535bfa2..7e92648b 100644 --- a/spec/lib/droplet_kit/models/loadbalancer_spec.rb +++ b/spec/lib/droplet_kit/models/loadbalancer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::LoadBalancer do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::LoadBalancer do let(:lb) { described_class.new(sticky_sessions: { cookie_ttl_seconds: '500' }) } describe 'redirect_http_to_https' do diff --git a/spec/lib/droplet_kit/resources/account_resource_spec.rb b/spec/lib/droplet_kit/resources/account_resource_spec.rb index 53ec397f..993be108 100644 --- a/spec/lib/droplet_kit/resources/account_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/account_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::AccountResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::AccountResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/action_resource_spec.rb b/spec/lib/droplet_kit/resources/action_resource_spec.rb index f5b60c8b..5c57e31d 100644 --- a/spec/lib/droplet_kit/resources/action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ActionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ActionResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/balance_resource_spec.rb b/spec/lib/droplet_kit/resources/balance_resource_spec.rb index b4eacbd3..21e3cefa 100644 --- a/spec/lib/droplet_kit/resources/balance_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/balance_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::BalanceResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::BalanceResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/cdn_resource_spec.rb b/spec/lib/droplet_kit/resources/cdn_resource_spec.rb index 0f22140c..08ac32fe 100644 --- a/spec/lib/droplet_kit/resources/cdn_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/cdn_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::CDNResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::CDNResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/certificate_resource_spec.rb b/spec/lib/droplet_kit/resources/certificate_resource_spec.rb index 7e5cd76d..757c58ce 100644 --- a/spec/lib/droplet_kit/resources/certificate_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/certificate_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::CertificateResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::CertificateResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb b/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb index 8db4dc19..a4a3f5e4 100644 --- a/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/container_registry_repository_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ContainerRegistryRepositoryResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ContainerRegistryRepositoryResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb b/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb index c5674a31..6c8f939f 100644 --- a/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/container_registry_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ContainerRegistryResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ContainerRegistryResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/database_resource_spec.rb b/spec/lib/droplet_kit/resources/database_resource_spec.rb index bed7ce82..2e3b8a24 100644 --- a/spec/lib/droplet_kit/resources/database_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/database_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DatabaseResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::DatabaseResource do subject(:resource) { described_class.new(connection: connection) } let(:database_cluster_id) { '9cc10173-e9ea-4176-9dbc-a4cee4c4ff30' } diff --git a/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb b/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb index fc9c91ab..3adc5cc0 100644 --- a/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DomainRecordResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::DomainRecordResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/domain_resource_spec.rb b/spec/lib/droplet_kit/resources/domain_resource_spec.rb index 12561120..49f6e85a 100644 --- a/spec/lib/droplet_kit/resources/domain_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/domain_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DomainResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::DomainResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb b/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb index cb1dc89e..d0aaf6a9 100644 --- a/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DropletActionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::DropletActionResource do subject(:resource) { described_class.new(connection: connection) } let(:droplet_id) { 1066 } diff --git a/spec/lib/droplet_kit/resources/droplet_resource_spec.rb b/spec/lib/droplet_kit/resources/droplet_resource_spec.rb index dacb8413..b54a170d 100644 --- a/spec/lib/droplet_kit/resources/droplet_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/droplet_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DropletResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::DropletResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb b/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb index 43d9f51c..c7b24397 100644 --- a/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::DropletUpgradeResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::DropletUpgradeResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/firewall_resource_spec.rb b/spec/lib/droplet_kit/resources/firewall_resource_spec.rb index 87790239..14de6394 100644 --- a/spec/lib/droplet_kit/resources/firewall_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/firewall_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::FirewallResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::FirewallResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb b/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb index 10827776..7fbeeb75 100644 --- a/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::FloatingIpActionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::FloatingIpActionResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb b/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb index 0354783b..92c894bf 100644 --- a/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::FloatingIpResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::FloatingIpResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/image_action_resource_spec.rb b/spec/lib/droplet_kit/resources/image_action_resource_spec.rb index ecb659ad..44617097 100644 --- a/spec/lib/droplet_kit/resources/image_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/image_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ImageActionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ImageActionResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/image_resource_spec.rb b/spec/lib/droplet_kit/resources/image_resource_spec.rb index fb863107..719602c9 100644 --- a/spec/lib/droplet_kit/resources/image_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/image_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ImageResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ImageResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/invoice_resource_spec.rb b/spec/lib/droplet_kit/resources/invoice_resource_spec.rb index c504aaaa..6152dfb8 100644 --- a/spec/lib/droplet_kit/resources/invoice_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/invoice_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::InvoiceResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::InvoiceResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb b/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb index 6c66c040..d3a1e658 100644 --- a/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::KubernetesClusterResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::KubernetesClusterResource do subject(:resource) { described_class.new(connection: connection) } let(:kubernetes_node_pool_attributes) { DropletKit::KubernetesNodePool.new.attributes } diff --git a/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb b/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb index 5a265136..46aab19f 100644 --- a/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/kubernetes_options_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::KubernetesOptionsResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::KubernetesOptionsResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb b/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb index 21da26d5..faa4f37f 100644 --- a/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::LoadBalancerResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::LoadBalancerResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/project_resource_spec.rb b/spec/lib/droplet_kit/resources/project_resource_spec.rb index d80a8a17..8ded22c2 100644 --- a/spec/lib/droplet_kit/resources/project_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/project_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DropletKit::ProjectResource do # rubocop:todo RSpec/SpecFilePathFormat +describe DropletKit::ProjectResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/region_resource_spec.rb b/spec/lib/droplet_kit/resources/region_resource_spec.rb index 406ef05b..337ccedf 100644 --- a/spec/lib/droplet_kit/resources/region_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/region_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::RegionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::RegionResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb b/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb index 4a2486ae..6369c00a 100644 --- a/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/reserved_ip_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ReservedIpActionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ReservedIpActionResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb b/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb index 52ca46fe..c05b7d4b 100644 --- a/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::ReservedIpResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::ReservedIpResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/size_resource_spec.rb b/spec/lib/droplet_kit/resources/size_resource_spec.rb index b34beee4..13571f4c 100644 --- a/spec/lib/droplet_kit/resources/size_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/size_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::SizeResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::SizeResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb b/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb index 4ffce1cc..3f37ab61 100644 --- a/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/snapshot_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::SnapshotResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::SnapshotResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb b/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb index 6a9c306b..df9342f0 100644 --- a/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::SSHKeyResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::SSHKeyResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/tag_resource_spec.rb b/spec/lib/droplet_kit/resources/tag_resource_spec.rb index c229b1cc..3720000b 100644 --- a/spec/lib/droplet_kit/resources/tag_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/tag_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DropletKit::TagResource do # rubocop:todo RSpec/SpecFilePathFormat +describe DropletKit::TagResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb b/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb index ee334819..e6555f3a 100644 --- a/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/volume_action_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VolumeActionResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::VolumeActionResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/volume_resource_spec.rb b/spec/lib/droplet_kit/resources/volume_resource_spec.rb index 31e899a6..9c1ede0c 100644 --- a/spec/lib/droplet_kit/resources/volume_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/volume_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VolumeResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::VolumeResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb index 14a4243f..9a716e07 100644 --- a/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_peering_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VPCPeeringResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::VPCPeeringResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources' diff --git a/spec/lib/droplet_kit/resources/vpc_resource_spec.rb b/spec/lib/droplet_kit/resources/vpc_resource_spec.rb index 96328cbd..45d03306 100644 --- a/spec/lib/droplet_kit/resources/vpc_resource_spec.rb +++ b/spec/lib/droplet_kit/resources/vpc_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe DropletKit::VPCResource do # rubocop:todo RSpec/SpecFilePathFormat +RSpec.describe DropletKit::VPCResource do subject(:resource) { described_class.new(connection: connection) } include_context 'resources'