Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump rubocop-rspec from 2.25.0 to 2.26.0 #3586

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ group :test do
gem 'rspec-wait'
gem 'rubocop', '~> 1.59.0'
gem 'rubocop-rails', '~> 2.23'
gem 'rubocop-rspec', '~> 2.25'
gem 'rubocop-rspec', '~> 2.26'
gem 'rubocop-sequel', '~> 0.3.4'
gem 'timecop'
gem 'webmock', '> 2.3.1'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,16 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop-factory_bot (2.25.0)
rubocop (~> 1.33)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.25.0)
rubocop-rspec (2.26.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down Expand Up @@ -643,7 +643,7 @@ DEPENDENCIES
rspec_api_documentation (>= 6.1.0)
rubocop (~> 1.59.0)
rubocop-rails (~> 2.23)
rubocop-rspec (~> 2.25)
rubocop-rspec (~> 2.26)
rubocop-sequel (~> 0.3.4)
rubyzip (>= 1.3.0)
sequel (~> 5.75)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/actions/deployment_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ module VCAP::CloudController
})
end

it 'will raise a DeploymentCreate::Error with the correct message' do
it 'raises a DeploymentCreate::Error with the correct message' do
expect do
expect do
DeploymentCreate.create(app:, message:, user_audit_info:)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/actions/manifest_route_update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module VCAP::CloudController
RouteMappingModel.make(app: app, route: route2)
end

it 'will update (or recreate) the route mapping with the new protocol' do
it 'updates (or recreates) the route mapping with the new protocol' do
ManifestRouteUpdate.update(app.guid, message, user_audit_info)

route_mappings = app.reload.route_mappings
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/controllers/v3/spaces_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@
end

context 'when the org has not been entitled with the isolation segment' do
it 'will not assign an isolation segment to a space in a different org' do
it 'does not assign an isolation segment to a space in a different org' do
patch :update_isolation_segment, params: { guid: space3.guid }.merge(update_message), as: :json

expect(response).to have_http_status(:unprocessable_entity)
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/jobs/runtime/orphaned_blobs_cleanup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ module Jobs::Runtime
[double(:blob, key: 're/al/')]
end

it 'will never mark the blob as an orphan' do
it 'never marks the blob as an orphan' do
expect(OrphanedBlob.count).to eq(0)
job.perform
expect(OrphanedBlob.count).to eq(0)
Expand All @@ -276,7 +276,7 @@ module Jobs::Runtime
]
end

it 'will never mark the blob as an orphan' do
it 'never marks the blob as an orphan' do
expect(OrphanedBlob.count).to eq(0)
job.perform
expect(OrphanedBlob.count).to eq(0)
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/lib/cloud_controller/encryptor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ module VCAP::CloudController
end

context 'when the label is found in the hash' do
it 'will encrypt using the value corresponding to the label' do
it 'encrypts using the value corresponding to the label' do
allow(Encryptor).to receive(:current_encryption_key_label).and_return('death')
expect(Encryptor.encrypt(input, salt)).to eql(encrypted_death_string)
end
end

context 'when the label is not found in the hash' do
it 'will encrypt using current db_encryption_key when the label is not nil' do
it 'encrypts using current db_encryption_key when the label is not nil' do
allow(Encryptor).to receive(:current_encryption_key_label).and_return('Inigo Montoya')
expect(Encryptor.encrypt(input, salt)).to eql(encrypted_legacy_string)
end

it 'will encrypt using current db_encryption_key when the label is nil' do
it 'encrypts using current db_encryption_key when the label is nil' do
allow(Encryptor).to receive(:current_encryption_key_label).and_return(nil)
expect(Encryptor.encrypt(input, salt)).to eql(encrypted_legacy_string)
end
Expand All @@ -76,7 +76,7 @@ module VCAP::CloudController
allow(Encryptor).to receive(:current_encryption_key_label).and_return('foo')
end

it 'will encrypt using db_encryption_key' do
it 'encrypts using db_encryption_key' do
expect(Encryptor.encrypt(input, salt)).to eql(encrypted_legacy_string)
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/messages/validators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -629,25 +629,25 @@ class Relationships < VCAP::CloudController::BaseMessage
end

context 'requires a valid timestamp' do
it "won't accept a malformed timestamp" do
it 'does not accept a malformed timestamp' do
message = timestamp_class.new({ field: [Time.now.utc.iso8601.to_s, 'bogus'] })
expect(message).not_to be_valid
expect(message.errors[:field]).to include("has an invalid timestamp format. Timestamps should be formatted as 'YYYY-MM-DDThh:mm:ssZ'")
end

it "won't accept garbage" do
it 'does not accept garbage' do
message = timestamp_class.new({ field: { gt: 123 } })
expect(message).not_to be_valid
expect(message.errors[:field]).to include("has an invalid timestamp format. Timestamps should be formatted as 'YYYY-MM-DDThh:mm:ssZ'")
end

it "won't accept fractional seconds even though it's ISO 8601-compliant" do
it "does not accept fractional seconds even though it's ISO 8601-compliant" do
message = timestamp_class.new({ field: { gt: '2020-06-30T12:34:56.78Z' } })
expect(message).not_to be_valid
expect(message.errors[:field]).to include("has an invalid timestamp format. Timestamps should be formatted as 'YYYY-MM-DDThh:mm:ssZ'")
end

it "won't accept local time zones even though it's ISO 8601-compliant" do
it "does not accept local time zones even though it's ISO 8601-compliant" do
message = timestamp_class.new({ field: { gt: '2020-06-30T12:34:56.78-0700' } })
expect(message).not_to be_valid
expect(message.errors[:field]).to include("has an invalid timestamp format. Timestamps should be formatted as 'YYYY-MM-DDThh:mm:ssZ'")
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/models/runtime/buildpack_bits_delete_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module VCAP::CloudController
end

context 'when the blob exists' do
it 'will create a job with attributes' do
it 'creates a job with attributes' do
attrs = blobstore.blob(key).attributes
job_attrs = {
last_modified: attrs[:last_modified],
Expand All @@ -48,7 +48,7 @@ module VCAP::CloudController
end

context 'when the blob does not exist' do
it 'will not create a job' do
it 'does not create a job' do
blobstore.delete(key)

expect(Jobs::Runtime::BlobstoreDelete).not_to receive(:new)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/models/runtime/buildpack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def ordered_buildpacks
context 'when there is a buildpack with nil stack' do
let!(:buildpack) { Buildpack.create(name: 'oscar', stack: nil) }

it 'will allow updating a different field' do
it 'allows updating a different field' do
expect do
buildpack.update(filename: '/some/file')
end.not_to raise_error
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/models/runtime/quota_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module VCAP::CloudController
quota_definition.trial_db_allowed = true
end

it 'will not change the value returned (deprecated)' do
it 'does not change the value returned (deprecated)' do
expect do
quota_definition.trial_db_allowed = true
end.not_to(change do
Expand Down
28 changes: 14 additions & 14 deletions spec/unit/repositories/app_usage_event_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ module Repositories
let(:parent_app) { AppModel.make(name: 'parent-app') }
let(:process) { ProcessModelFactory.make(app: parent_app, type: 'other') }

it 'will create an event which matches the app' do
it 'creates an event which matches the app' do
event = repository.create_from_process(process)
expect(event).to match_app(process)
expect(event.parent_app_name).to eq('parent-app')
expect(event.parent_app_guid).to eq(parent_app.guid)
expect(event.process_type).to eq('other')
end

it 'will create an event with default previous attributes' do
it 'creates an event with default previous attributes' do
event = repository.create_from_process(process)

default_instances = ProcessModel.db_schema[:instances][:default].to_i
Expand All @@ -48,7 +48,7 @@ module Repositories
context 'when a custom state is provided' do
let(:custom_state) { 'CUSTOM' }

it 'will populate the event with the custom state' do
it 'populates the event with the custom state' do
event = repository.create_from_process(process, custom_state)
expect(event.state).to eq(custom_state)

Expand All @@ -64,14 +64,14 @@ module Repositories
process.reload
end

it 'will create an event with pending package state' do
it 'creates an event with pending package state' do
event = repository.create_from_process(process)
expect(event).to match_app(process)
end
end

context 'when the package is staged' do
it 'will create an event with staged package state' do
it 'creates an event with staged package state' do
event = repository.create_from_process(process)
expect(event).to match_app(process)
end
Expand All @@ -83,7 +83,7 @@ module Repositories
process.reload
end

it 'will create an event with failed package state' do
it 'creates an event with failed package state' do
event = repository.create_from_process(process)
expect(event).to match_app(process)
end
Expand All @@ -98,7 +98,7 @@ module Repositories
)
end

it 'will create an event that contains the detected buildpack guid and name' do
it 'creates an event that contains the detected buildpack guid and name' do
event = repository.create_from_process(process)
expect(event).to match_app(process)
expect(event.buildpack_guid).to eq('buildpack-guid')
Expand All @@ -113,7 +113,7 @@ module Repositories
process.app.lifecycle_data.update(buildpacks: [buildpack_url])
end

it 'will create an event with the buildpack url as the name' do
it 'creates an event with the buildpack url as the name' do
event = repository.create_from_process(process)
expect(event.buildpack_name).to eq('https://git.example.com/repo.git')
end
Expand All @@ -127,7 +127,7 @@ module Repositories
end
end

it 'will create an event without a buildpack guid' do
it 'creates an event without a buildpack guid' do
event = repository.create_from_process(process)
expect(event.buildpack_guid).to be_nil
end
Expand All @@ -138,7 +138,7 @@ module Repositories
process.app.lifecycle_data.update(buildpacks: nil)
end

it 'will create an event that does not contain buildpack name or guid' do
it 'creates an event that does not contain buildpack name or guid' do
event = repository.create_from_process(process)
expect(event.buildpack_guid).to be_nil
expect(event.buildpack_name).to be_nil
Expand All @@ -150,7 +150,7 @@ module Repositories
process.state = nil
end

it 'will raise an error' do
it 'raises an error' do
expect do
repository.create_from_process(process)
end.to raise_error(Sequel::NotNullConstraintViolation)
Expand Down Expand Up @@ -518,7 +518,7 @@ module Repositories
allow(ProcessObserver).to receive(:updated)
end

it 'will purge all existing events' do
it 'purges all existing events' do
3.times { repository.create_from_process(process) }

expect do
Expand Down Expand Up @@ -691,7 +691,7 @@ module Repositories
end
end

it 'will delete events created before the specified cutoff time' do
it 'deletes events created before the specified cutoff time' do
process = ProcessModel.make
repository.create_from_process(process)

Expand All @@ -702,7 +702,7 @@ module Repositories
expect(AppUsageEvent.last).to match_app(process)
end

it 'will keep the last record even if before the cutoff age' do
it 'keeps the last record even if before the cutoff age' do
expect do
repository.delete_events_older_than(cutoff_age_in_days)
end.to change(AppUsageEvent, :count).to(1)
Expand Down
14 changes: 7 additions & 7 deletions spec/unit/repositories/service_usage_event_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ module Repositories
context 'with managed service instance' do
let(:service_instance) { ManagedServiceInstance.make }

it 'will create an event which matches the service instance and custom state' do
it 'creates an event which matches the service instance and custom state' do
event = repository.create_from_service_instance(service_instance, custom_state)

expect(event.state).to eq(custom_state)
expect(event).to match_service_instance(service_instance)
end

context 'fails to create the event if no custom state provided' do
it 'will raise an error' do
it 'raises an error' do
expect do
repository.create_from_service_instance(service_instance, nil)
end.to raise_error(Sequel::NotNullConstraintViolation)
Expand All @@ -53,7 +53,7 @@ module Repositories
service_instance.space = nil
end

it 'will raise an error' do
it 'raises an error' do
expect do
repository.create_from_service_instance(service_instance, custom_state)
end.to raise_error(NoMethodError)
Expand All @@ -65,7 +65,7 @@ module Repositories
context 'with user provided service instance' do
let(:service_instance) { UserProvidedServiceInstance.make }

it 'will create an event if service instance does not have a service plan' do
it 'creates an event if service instance does not have a service plan' do
event = repository.create_from_service_instance(service_instance, custom_state)

expect(event.state).to eq(custom_state)
Expand Down Expand Up @@ -93,7 +93,7 @@ module Repositories
end
end

it 'will purge all existing events' do
it 'purges all existing events' do
ServiceInstance.each(&:destroy)

expect do
Expand Down Expand Up @@ -170,7 +170,7 @@ module Repositories
end
end

it 'will delete events created before the specified cutoff time' do
it 'deletes events created before the specified cutoff time' do
new_event = repository.create_from_service_instance(service_instance, 'SOME-STATE')

expect do
Expand All @@ -180,7 +180,7 @@ module Repositories
expect(ServiceUsageEvent.last).to eq(new_event.reload)
end

it 'will keep the last record even if before the cutoff age' do
it 'keeps the last record even if before the cutoff age' do
expect do
repository.delete_events_older_than(cutoff_age_in_days)
end.to change(ServiceUsageEvent, :count).to(1)
Expand Down